Node.js安装npm安装节点模块时出错

时间:2018-03-08 07:44:18

标签: node.js reactjs npm npm-scripts

我必须在节点模块的项目中安装node.js,同时安装节点模块,显示错误。如何纠正这个错误。

注意:我运行npm run clean并删除我的node modules文件夹并再次运行npm install但是没有用完。

如果我使用npm run build:client运行此项目,它还会显示

缺少脚本:build:Clinet

如果添加,删除或安装,请告诉我。

...谢谢

"c:\Python\27\python.exe" i
    n the PATH
    gyp verb `which` failed Error: not found: c:\Python\27\python.exe
    gyp verb `which` failed     at getNotFoundError (C:\digitalframe\node_modules\wh
    ich\which.js:13:12)
    gyp verb `which` failed     at F (C:\digitalframe\node_modules\which\which.js:68
    :19)
    gyp verb `which` failed     at E (C:\digitalframe\node_modules\which\which.js:80
    :29)
gyp verb `which` failed     at C:\digitalframe\node_modules\which\which.js:89:16

gyp verb `which` failed     at C:\digitalframe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\digitalframe\node_modules\isexe\windows.js:36:
5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  c:\Python\27\python.exe { Error: not found: c:\Python\2
7\python.exe
gyp verb `which` failed     at getNotFoundError (C:\digitalframe\node_modules\wh
ich\which.js:13:12)
gyp verb `which` failed     at F (C:\digitalframe\node_modules\which\which.js:68
:19)
gyp verb `which` failed     at E (C:\digitalframe\node_modules\which\which.js:80
:29)
gyp verb `which` failed     at C:\digitalframe\node_modules\which\which.js:89:16

gyp verb `which` failed     at C:\digitalframe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\digitalframe\node_modules\isexe\windows.js:36:
5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: c:\\Python\\27\\python.exe\n
    at getNotFoundError (C:\\digitalframe\\node_modules\\which\\which.js:13:12)\
n    at F (C:\\digitalframe\\node_modules\\which\\which.js:68:19)\n    at E (C:\
\digitalframe\\node_modules\\which\\which.js:80:29)\n    at C:\\digitalframe\\no
de_modules\\which\\which.js:89:16\n    at C:\\digitalframe\\node_modules\\isexe\
\index.js:42:5\n    at C:\\digitalframe\\node_modules\\isexe\\windows.js:36:5\n
   at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "c:\Python\27\python.exe". checking python launcher
gyp verb could not find "c:\Python\27\python.exe". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "c:\Python\27\python.exe", yo
u can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\digitalframe\node_modules\no
de-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\digitalframe\node_modules\nod
e-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\digitalframe\node_modules\graceful-fs\polyfills.js:284:
29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\digitalframe\\node_m
odules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--li
bsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\digitalframe\node_modules\node-sass
gyp ERR! node -v v8.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN Error: EPERM: operation not permitted, lstat 'C:\digitalframe\node_modu
les\yargs-parser\node_modules'
npm WARN  { Error: EPERM: operation not permitted, lstat 'C:\digitalframe\node_m
odules\yargs-parser\node_modules'
npm WARN   stack: 'Error: EPERM: operation not permitted, lstat \'C:\\digitalfra
me\\node_modules\\yargs-parser\\node_modules\'',
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'lstat',
npm WARN   path: 'C:\\digitalframe\\node_modules\\yargs-parser\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:

2 个答案:

答案 0 :(得分:0)

错误消息说:Error: not found: c:\Python\27\python.exe,您需要Python2.7来构建节点模块。

答案 1 :(得分:0)

据我所知,你使用node-gyp,你需要在安装node-gyp(python等)之前安装所需的模块。我可以看到你在Windows机器上运行它,众所周知,这个模块在Windows机器上很糟糕,几乎没有工作,所以我建议放弃它并试图找到更好的解决方案来解决你的问题。