我用的是Windows 10, Node 5.6.0和npm 3.6.0。我试图安装角材料和mdi到我的工作文件夹。NPM安装角材质mdi错误:

+-- angular@1.5.0

+-- UNMET PEER DEPENDENCY angular-animate@^1.5.0

+-- UNMET PEER DEPENDENCY angular-aria@^1.5.0

+-- angular-material@1.0.6

+-- UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57

npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\xxxxx\Desktop\ngClassifieds\package.json' 

npm WARN angular-material@1.0.6 requires a peer of
angular-animate@^1.5.0 but none was installed. 

npm WARN angular-material@1.0.6 requires a peer of angular-aria@^1.5.0
but none was installed. 

npm WARN angular-material@1.0.6 requires a peer of
angular-messages@^1.5.0 but none was installed.

如何解决这个问题来安装AngularJS材质和MDI ?

我正在尝试将nodeJs安装到我的Ubuntu 14.04中,以便使用GruntJs。

我读过关于Ubuntu不同的安装方法(问题?),所以我是这样安装它的:

sudo apt-get install npm

sudo npm install -g grunt-cli

输入grunt之后,我得到了错误:

/usr/bin/env: node: No such file or directory

所以,我试过:

curl -sL https://deb.nodesource.com/setup | sudo bash -

sudo apt-get install -y nodejs

sudo apt-get update

再次尝试,仍然得到错误,我尝试了:

sudo add-apt-repository https://launchpad.net/~chris-lea/+archive/node.js/

sudo apt-get install -y nodejs

我得到了这个信息:

nodejs is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.

以防万一,我试着清理了一下:

sudo apt-get autoremove

但是,错误仍然存在:当我输入grunt时,我仍然得到/usr/bin/env: node: No这样的文件或目录

我该怎么办?

刚刚遇到了这个错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: nexttwin@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from react-hook-mousetrap@2.0.4
npm ERR! node_modules/react-hook-mousetrap
npm ERR!   react-hook-mousetrap@"*" from the root project
npm ERR! 

我试图安装的模块似乎与我已经安装的模块有不同的对等依赖关系。似乎npm改变了它在这方面的行为,现在让安装失败。

我现在能做些什么来弥补呢?我不想因此而降低我的React版本。

我知道有一个标记叫做——legacy-peer-deps,但我不确定这到底是什么,是否建议使用它/潜在的缺点是什么?我认为npm让安装失败是有原因的。

这很奇怪,因为直到最近我都在用纱线,而且一切都很好。

当创建一个新的Angular 5项目时:

节点版本号:8.9.2

NPM版本:5.5.1

我的命令是:

npm install -g @angular/cli

错误是:

npm ERR! **Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'**
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Aashitec\AppData\Roaming\npm-cache\_logs\2017-12-06T13_10_10_729Z-debug.log

错误日志在这里

我试图学习react,所以我有这个全堆栈react投票应用程序的示例代码,我试图让它工作,但在运行npm安装后,紧接着npm启动,当我运行npm启动时,我收到以下错误,任何人都可以帮助我解决这个问题:

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server"
npm ERR! node v7.5.0
npm ERR! npm  v4.3.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! voting_app@1.1.0 server: `live-server --public --    
host=localhost --port=3000 --middleware=./disable-browser-cache.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the voting_app@1.1.0 server script 'live-server --
public --host=localhost --port=3000 --middleware=./disable-browser- 
cache.js'.
npm ERR! Make sure you have the latest version of node.js and npm  
installed.
npm ERR! If you do, this is most likely a problem with the voting_app  
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     live-server --public --host=localhost --port=3000 --  
middleware=./disable-browser-cache.js
npm ERR! You can get information on how to open an issue for this  
project with:
npm ERR!     npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls voting_app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-
debug.log

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.5.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! voting_app@1.1.0 start: `npm run server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the voting_app@1.1.0 start script 'npm run server'.
npm ERR! Make sure you have the latest version of node.js and npm 
installed.
npm ERR! If you do, this is most likely a problem with the voting_app    
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run server

npm ERR! You can get information on how to open an issue for this   
project with:
npm ERR!     npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls voting_app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_655Z-
debug.log

这是我的package.json:

{
  "name": "voting_app",
  "version": "1.1.0",
  "author": "Fullstack.io",
  "scripts": {
    "go": "open http://localhost:3000; npm run server",
    "e2e": "nightwatch",
    "test": "./node_modules/.bin/concurrently -k 'npm run server' 'npm  
run e2e'",
    "start": "npm run server",
    "server": "live-server public --host=localhost --port=3000 --  
middleware=./disable-browser-cache.js"
  },
  "private": true,
  "devDependencies": {
  "concurrently": "2.2.0",
  "live-server": "git://github.com/acco/live-server.git"
},
  "dependencies": {
  "semantic-ui": "git://github.com/Semantic-Org/Semantic-
  UI.git#27d58a01793b66318478fbc5b6676804d22d065d"
  }
}

最后是我的日志文件:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@4.3.0
3 info using node@v7.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle voting_app@1.1.0~prestart: voting_app@1.1.0
6 silly lifecycle voting_app@1.1.0~prestart: no script for prestart, continuing
7 info lifecycle voting_app@1.1.0~start: voting_app@1.1.0
8 verbose lifecycle voting_app@1.1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle voting_app@1.1.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1@global/bin:/Users/ItsMeMrLi/.rvm/rubies/ruby-2.3.1/bin:/Users/ItsMeMrLi/.cargo/bin:/usr/local/Cellar/smlnj/110.74/libexec/bin:/usr/local/bin:/Users/ItsMeMrLi/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Downloads/geckodriver:/usr/local/bin:/Users/ItsMeMrLi/.rvm/bin
10 verbose lifecycle voting_app@1.1.0~start: CWD: /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
11 silly lifecycle voting_app@1.1.0~start: Args: [ '-c', 'npm run server' ]
12 silly lifecycle voting_app@1.1.0~start: Returned: code: 1  signal: null
13 info lifecycle voting_app@1.1.0~start: Failed to exec start script
14 verbose stack Error: voting_app@1.1.0 start: `npm run server`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:192:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:192:7)
14 verbose stack     at maybeClose (internal/child_process.js:890:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid voting_app@1.1.0
16 verbose cwd /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.5.0
20 error npm  v4.3.0
21 error code ELIFECYCLE
22 error errno 1
23 error voting_app@1.1.0 start: `npm run server`
23 error Exit status 1
24 error Failed at the voting_app@1.1.0 start script 'npm run server'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the voting_app package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     npm run server
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs voting_app
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls voting_app
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

我正在使用持续集成,并发现了npm ci命令。

我不知道在我的工作流中使用这个命令有什么好处。

它更快吗?这会让考试更难吗,之后呢?

我有一个下载的模块repo,我想在本地安装它,而不是全局安装在另一个目录?

有什么简单的方法吗?

我最近刚升级到npm@5。我现在有一个包锁。包含package.json中的所有内容的Json文件。我希望,当我运行npm install时,依赖版本将从锁文件中提取,以确定应该在我的node_modules目录中安装什么。奇怪的是,它实际上最终修改和重写了我的包锁。json文件。

例如,锁文件的typescript被指定为2.1.6版本。然后,在执行npm install命令后,版本被更改为2.4.1。这似乎违背了锁文件的全部目的。

我错过了什么?我如何让npm尊重我的锁文件?

在运行npm安装时看到以下错误,需要node-gyp…但可以被任何需要xcode-select的东西触发。

xcodebuild工具需要Xcode,但是是活动的 开发者目录'/Library/ developer /CommandLineTools'是一个命令 直线工具实例

有什么问题吗?

尝试从GitHub安装模块会导致以下错误:

package.json上的ENOENT错误。

容易复制使用express:

NPM安装https://github.com/visionmedia/express抛出错误。

NPM安装快速工程。

为什么我不能从GitHub安装?

下面是控制台输出:

npm http GET https://github.com/visionmedia/express.git
npm http 200 https://github.com/visionmedia/express.git
npm ERR! not a package /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/tmp.tgz
npm ERR! Error: ENOENT, open '/home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "https://github.com/visionmedia/express.git"
npm ERR! cwd /home/guym/dev_env/projects_GIT/proj/somename
npm ERR! node -v v0.10.10
npm ERR! npm -v 1.2.25
npm ERR! path /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/guym/dev_env/projects_GIT/proj/somename/npm-debug.log
npm ERR! not ok code 0