Articles of npm

为什么不会在我的Windows机器上安装模块而不将它们标记为全局?

出于某种原因,npm只会将模块全局安装到我的Windows机器上。 每当我尝试安装没有-g标签的时候,在吐出一个错误之前,npm会挂在初始安装加载栏上一两分钟。 我只是跑了一个testing,并尝试npm install webpack ,这里是由此产生的错误日志: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install', 1 verbose cli 'webpack' ] 2 info using npm@3.10.8 3 info using node@v6.9.1 4 silly loadCurrentTree Starting 5 silly install loadCurrentTree 6 silly install readLocalPackageData […]

angular度cli安装错误窗口

在尝试安装angular-cli时,在我的命令提示符中出现奇怪的错误消息。 我也以pipe理员身份运行CMD.exe。 错误消息如下所示: npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! Cannot read property 'path' of null npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include […]

由不同的包共享的npm依赖被安装两次

我使用了两个具有相同依赖性的包: "aws-sdk": "^2.22.0" 。 当我运行npm install ,这两个软件包都将相同的软件包安装在自己的node_modules子目录中,如下所示: my_project node_modules package_1 node_modules aws_sdk … package_2 node_modules aws_sdk … aws_sdk … 你会注意到我的基础项目也使用aws-sdk,所以它被安装了第三次。 我的项目单独权重不到100kb,但aws-sdk包权重为〜17MB,总大小为〜50MB,这是荒谬的。 我试过npm dedupe和flatten-packages软件包,这没什么区别。 我能做些什么来使npm只安装一次? 我使用的是Windows 10,节点7.4.0和npm 4.0.5。

如何在Windows上构buildVSCode?

我正在尝试从源代码构buildhttps://github.com/Microsoft/vscode ,但我不确定要做什么。 当我运行scripts\npm.bat install ,它成功完成。 然后我跑了scripts\code.bat和一个陌生人窗口出现。 这是编译版本? 它似乎没有正常工作。 我如何创build完整的构build? 这一页: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source 不提供如何从源创build可执行文件。 当我运行scripts\npm.bat install应该发生什么? 现在我只能看到它在一些JavaScript文件中创build文件夹out / out-build ,如下所示。 这些文件是什么,我用他们做什么? 之后,我尝试运行scripts\code.bat并创build一个类似于文件夹.build\electron上稳定版本的可执行文件: 但是当我运行npm run watch ,这个错误是抛出的: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory npm ERR! Windows_NT 10.0.15063 npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch" npm ERR! node v6.11.0 npm ERR! npm v3.10.10 npm […]

npm和git命令行在Windows上很慢; 我怎么理清原因?

我怀疑它是Symantec Endpoint Protection,但是我的证据是不确定的,支持似乎认为它没有问题。 例如: $ date && npm test && date Thu Aug 24 13:58:37 PDT 2017 > gamma-listener@0.2.0 test C:\work\gamma-listener > lab -Rv -e development -r console ./test/unit … 9 tests complete (2 skipped) Test duration: 267 ms Assertions count: 24 (verbosity: 2.67) No global variable leaks detected Thu Aug 24 13:58:53 PDT 2017 […]

NPM不适用于Windows

我用安装程序在windows上安装了Node.js,并尝试运行npm命令,但是它不会运行。 当我input以下内容时。 npm install socket.io 我懂了 module.js:337 throw new Error("Cannot find module '" + request + "'"); ^ Error: Cannot find module 'C:\Windows\System32\node_modules\npm\bin\npm-cli.js' at Function._resolveFilename (module.js:337:11) at Function._load (module.js:279:25) at Array.0 (module.js:484:10) at EventEmitter._tickCallback (node.js:190:38) 当我input npm 我懂了 module.js:337 throw new Error("Cannot find module '" + request + "'"); ^ Error: Cannot find module 'C:\Windows\System32\node_modules\npm\bin\npm-cli.js' […]

用npm安装postgres

我有我的Windows机器上通过npm installi pg的问题。 它抱怨python,但我已经添加了python env。 变数在许多方面无济于事。 这些都是我试图宣告env的方法。 变种。 C:/Program Files/Python "C:/Program Files/Python" C:/Program Files/Python/python.exe "C:/Program Files/Python/python.exe" 这是错误: D:\Projects\GitHub\inmotion>npm -g install pg npm http GET https://registry.npmjs.org/pg npm http 200 https://registry.npmjs.org/pg npm http GET https://registry.npmjs.org/generic-pool/1.0.12 npm http 200 https://registry.npmjs.org/generic-pool/1.0.12 npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.12.tgz npm http 200 https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.12.tgz > pg@0.8.3 install C:\Users\Guzza\AppData\Roaming\npm\node_modules\pg > node-gyp rebuild || (exit 0) […]

在Windows上,npm install非常脆弱

我有一个使用grunt构build的项目。 这是我的packages.json。 … "devDependencies": { "grunt": "^0.4.4", "grunt-autoprefixer": "^0.7.3", "grunt-coffeelint": "0.0.10", "grunt-concurrent": "^0.5.0", "grunt-connect-proxy": "^0.1.10", "grunt-contrib-clean": "^0.5.0", "grunt-contrib-concat": "^0.4.0", "grunt-contrib-connect": "^0.7.1", "grunt-contrib-copy": "^0.5.0", "grunt-contrib-csslint": "^0.2.0", "grunt-contrib-cssmin": "^0.9.0", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-less": "^0.11.0", "grunt-contrib-requirejs": "^0.4.4", "grunt-contrib-stylus": "^0.15.1", "grunt-contrib-uglify": "^0.4.0", "grunt-contrib-watch": "^0.6.1", "grunt-modernizr": "^0.5.2", "grunt-newer": "^0.7.0", "jshint-stylish": "^0.2.0", "load-grunt-tasks": "^0.4.0", "rjs-build-analysis": "0.0.3", "time-grunt": "^0.3.1" }, … 我正在运行npm 1.4.13和节点v0.10.28 […]

NPM已停止在Windows 7 64位上工作,挂起安装/更新

在某个时候,我的版本NPM停止工作。 当我试图在几个星期前更新npm(从节点运输到1.4版本到现在的2.x版本),似乎已经发生了,而且已经变得越来越糟了。 我必须改变环境variables指向我的npm目录之前我的节点目录(拿起新版本的NPM),在那一刻,一切都停止工作。 我切换回环境variables,然后更新将只是挂起。 但奇怪的是,当我试图debugging它,并添加一个–verbose的命令更新将大部分时间工作。 有时候他们挂在那里 npm http GET https://registry.npmjs.org/PACKAGE_NAME 但大部分时间他们工作。 这现在发生在老版本的NPM(1.4.1)和我安装的新版本(2.1.17)上,所有的东西总是在GET命令上失败(通常并不总是第一个)。 我已经打高速caching清除,我已经消灭了临时目录,我试图擦除%APPDATA /漫游/ npm /,并重新安装一切。 我没有代理,但我已经运行: npm config set proxy 将代理设置为空白。 我已经将registry设置为http(而不是https),并将strict-ssl设置为false。 我已经卸载并重新安装nodejs,没有运气。 我试图从pipe理员cmd提示而不是一般的命令提示符运行命令都无济于事。 我已经没有想法,真的需要NPM来工作… 以下是在清除%APPDATA / roaming / npm目录后尝试安装grunt-cli的输出: C:\Users\Kris Erickson>npm install -g grunt-cli –verbose npm info it worked if it ends with ok npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe', npm verb cli […]

在Windows 7中将程序包添加到meteor应用程序时出现“node-gyp rebuild”安装错误

我试图添加一个包(mizzao:turkserver)到我的Meteor应用程序,但我一直得到这个错误: mizzao:turkserver: updating npm dependencies — request, libxmljs, validator, querystring, async, deepmerge… gypnpm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os .windows.x86_32\\dev_bundle\\bin\\\\node.exe" "C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os .windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install" "libxmljs@0.8.1" npm ERR! node v0.10.36 npm ERR! npm v2.7.3 npm ERR! code ELIFECYCLE npm ERR! libxmljs@0.8.1 install: `node-gyp rebuild` npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the […]