问答

cnpm install 时报错,请问应该怎么解决呢?

作者:admin 2021-05-15 我要评论

D:\wwwroot\discuz7\resources\framecnpm install- [28/70] Installing imurmurhash@^0.1.4platform unsupported babel-loader@7.1.5 ? webpack@4.44.2 ? watchp...

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>)
D:\wwwroot\discuz7\resources\frame>cnpm install
- [28/70] Installing imurmurhash@^0.1.4platform unsupported babel-loader@7.1.5 ? webpack@4.44.2 ? watchpack@1.7.5 ? chokidar@3.4.3 ? fsevents@~2.1.2 Package require os(darwin) not compatible with your platform(win32)
platform unsupported babel-loader@7.1.5 ? webpack@4.44.2 ? watchpack@1.7.5 ? watchpack-chokidar2@2.0.1 ? chokidar@2.1.8 ? fsevents@^1.2.7 Package require os(darwin) not compatible with your platform(win32)
[fsevents@~2.1.2] optional install error: Package require os(darwin) not compatible with your platform(win32)
[fsevents@^1.2.7] optional install error: Package require os(darwin) not compatible with your platform(win32)
√ Installed 70 packages
√ Linked 847 latest versions
[1/4] scripts.postinstall babel-plugin-transform-es2015-modules-commonjs@6.26.2 ? babel-runtime@6.26.0 ? core-js@^2.4.0 run "node -e \"try{require('./postinstall')}catch(e){}\"", root: "D:\\wwwroot\\discuz7\\resources\\frame\\node_modules\\_core-js@2.6.12@core-js"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

[1/4] scripts.postinstall babel-plugin-transform-es2015-modules-commonjs@6.26.2 ? babel-runtime@6.26.0 ? core-js@^2.4.0 finished in 69ms
[2/4] scripts.install fibers@^4.0.3 run "node build.js || nodejs build.js", root: "D:\\wwwroot\\discuz7\\resources\\frame\\node_modules\\_fibers@4.0.3@fibers"

D:\wwwroot\discuz7\resources\frame\node_modules\_fibers@4.0.3@fibers>node "C:\Users\Wang\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\node-gyp-bin\\node-gyp.js" rebuild --release
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:308:12)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Wang\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npminstall\\node-gyp-bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd D:\wwwroot\discuz7\resources\frame\node_modules\_fibers@4.0.3@fibers
gyp ERR! node -v v14.13.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
'nodejs' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
[npminstall:runscript:error] fibers@^4.0.3 scripts.install run "node build.js || nodejs build.js" error: Error [RunScriptError]: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1
    at ChildProcess.<anonymous> (C:\Users\Wang\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:96:21)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  stdio: [Object],
  exitcode: 1
}
× Install fail! RunScriptError: post install error, please remove node_modules before retry!
Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1
RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node build.js || nodejs build.js" error, exit code 1
    at ChildProcess.<anonymous> (C:\Users\Wang\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:96:21)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
npminstall version: 3.28.0
npminstall args: C:\Program Files\nodejs\node.exe C:\Users\Wang\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\Wang\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org
###

报错信息不是说了吗....

Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/nod...
Ubuntu users please run: sudo apt-get install g++ build-essential
RHEL users please run: yum install gcc-c++ and yum groupinstall 'Development Tools'
Alpine users please run: sudo apk add python make g++

你安装的这个npm包 fibers, 需要使用 node-gyp 这个工具编译成 Node.js addon, 所以你需要一些编译工具和套件. 大概就是 C++ 编译环境Python 吧. 具体的可以看一下文档

版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除

相关文章
  • 请问下prometheus怎么进行自定义的按业

    请问下prometheus怎么进行自定义的按业

  • 节流函数为什么,点击无效,监听窗口大

    节流函数为什么,点击无效,监听窗口大

  • express访问静态资源失败

    express访问静态资源失败

  • IE 浏览器下 match 方法报错

    IE 浏览器下 match 方法报错

腾讯云代理商
海外云服务器