npm

Why does `npm install` generate different `package-lock.json` files for the same `package.json` file?

我与影子孤独终老i 提交于 2021-01-27 07:40:34
问题 Here is the relevant part of my package.json file: "devDependencies": { "ajv": "^6.0.0", "webpack": "^4.0.0", "websocket": "^1.0.0", "bignumber.js": "^7.0.0", "decimal.js": "^10.0.0", "truffle": "4.1.11", "ganache-cli": "6.1.0", "solidity-coverage": "0.5.4", "ethereumjs-testrpc-sc": "6.1.2", "web3": "1.0.0-beta.34" } I have this file in two different repositories, on the same PC. When I run npm install in each one of these repositories at the same time, I get a different package-lock.json

Why does `npm install` generate different `package-lock.json` files for the same `package.json` file?

旧巷老猫 提交于 2021-01-27 07:38:54
问题 Here is the relevant part of my package.json file: "devDependencies": { "ajv": "^6.0.0", "webpack": "^4.0.0", "websocket": "^1.0.0", "bignumber.js": "^7.0.0", "decimal.js": "^10.0.0", "truffle": "4.1.11", "ganache-cli": "6.1.0", "solidity-coverage": "0.5.4", "ethereumjs-testrpc-sc": "6.1.2", "web3": "1.0.0-beta.34" } I have this file in two different repositories, on the same PC. When I run npm install in each one of these repositories at the same time, I get a different package-lock.json

nvm-windows 安装后,node 命令报错

风流意气都作罢 提交于 2021-01-27 06:42:04
下载地址: https://github.com/coreybutler/nvm-windows/releases 我是点下面这个直接安装的: 配置文件,我都是习惯在软件目录下建个 files 文件夹,然后全部放里面: 装完后,敲 nvm ,似乎正常,出现一堆命令,但是敲 npm / node 反而报错不行了,原来可以的,百度了下,提示修改环境变量 原来 NVM_SYMLINK 和 NVM_HOME 是一样的,现在把 NVM_SYMLINK 改成 node 所在的目录就可以了; 副作用: 装完之后,发现之前装的 node 被卸载了,然后现在的 node 目录又和之前的 node 目录不一样,导致了依赖 node 路径的许多程序都运行不了了,尤其是 sublime text 的不少插件,orz,,,索性直接用 vscode 了 参考文档: https://www.cnblogs.com/eastegg/p/7446081.html 来源: oschina 链接: https://my.oschina.net/u/4382082/blog/4249660

Node: check latest version of package programmatically

血红的双手。 提交于 2021-01-27 05:30:14
问题 I'd like my node package (published on npm) to alert the user when a new version is available. How can i check programmatically for the latest version of a published package and compare it to the current one? Thanks 回答1: You can combine the npmview (for getting remote version) and semver (for comparing versions) packages to do this: const npmview = require('npmview'); const semver = require('semver'); // get local package name and version from package.json (or wherever) const pkgName =

Nodemon not working anymore . Usage: nodemon [nodemon options] [script.js] [args]

蹲街弑〆低调 提交于 2021-01-27 05:22:31
问题 nodemon always worked for me. I always did nodemon server and it would run the server file and watch for updates and node would restart. But now when I do it, I get this in the cmd (I use windows): Usage: nodemon [nodemon options] [script.js] [args] See "nodemon --help" for more. I tried uninstalling and reinstalling nodemon globally but still get the feedback. now I have to restart the server with regular node on every update. EDIT:: This is what it looke like when i type in dir and press

npm error - Cannot find module './selenium-webdriver/lib/input'

送分小仙女□ 提交于 2021-01-27 04:58:06
问题 After I updated my Angular project's version from 5 to 7, I was getting a lot of vulnerabilities, to fix it - I ran all the commands that was suggested in the "npm audit" and all the vulnerabilities was fixed. But now when I run: ng serve I get this error: ERROR in node_modules/protractor/built/ptor.d.ts(33,17): error TS2307: Cannot find module './selenium-webdriver/lib/input'. Edit If I get in to the errors sources I can see the problem line: // node_modules/protractor/built/ptor.d.ts Key:

Generate declaration file with single module in TypeScript

北战南征 提交于 2021-01-27 04:32:25
问题 Given the following folder structure: src/ ├── foo.ts ├── bar.ts ├── baz.ts ├── index.ts Where foo.ts , bar.ts , and baz.ts each export a default class or thing: i.e. in the case of foo.ts : export default class Foo { x = 2; } Can we automatically generate a declaration file which declares one module my-module and exports foo.ts , bar.ts , and baz.ts as non-defaults ? I.e. I want tsc to generate the following: build/ ├── foo.js ├── bar.js ├── baz.js ├── index.js ├── index.d.ts Where index.d

Generate declaration file with single module in TypeScript

隐身守侯 提交于 2021-01-27 04:31:20
问题 Given the following folder structure: src/ ├── foo.ts ├── bar.ts ├── baz.ts ├── index.ts Where foo.ts , bar.ts , and baz.ts each export a default class or thing: i.e. in the case of foo.ts : export default class Foo { x = 2; } Can we automatically generate a declaration file which declares one module my-module and exports foo.ts , bar.ts , and baz.ts as non-defaults ? I.e. I want tsc to generate the following: build/ ├── foo.js ├── bar.js ├── baz.js ├── index.js ├── index.d.ts Where index.d

Generate declaration file with single module in TypeScript

佐手、 提交于 2021-01-27 04:30:40
问题 Given the following folder structure: src/ ├── foo.ts ├── bar.ts ├── baz.ts ├── index.ts Where foo.ts , bar.ts , and baz.ts each export a default class or thing: i.e. in the case of foo.ts : export default class Foo { x = 2; } Can we automatically generate a declaration file which declares one module my-module and exports foo.ts , bar.ts , and baz.ts as non-defaults ? I.e. I want tsc to generate the following: build/ ├── foo.js ├── bar.js ├── baz.js ├── index.js ├── index.d.ts Where index.d

React-native link is not working properly

孤者浪人 提交于 2021-01-27 04:19:54
问题 I tried installing and linking react-native sound into my project. However, when I run the following command in my project directory, react-native link react-native-sound the library doesn't link and I get the following result: Scanning 758 folders for symlinks in /Users/MY_USER_NAME/PROJECT_NAME/node_modules I think my node or npm setup is wrong. 回答1: Ok after some digging, I found the issue. https://github.com/facebook/react-native/pull/14863 Maybe try applying that fix locally, it should