不要在Ubuntu 20上安装'node

编程入门 行业动态 更新时间:2024-10-07 08:23:42

<a href=https://www.elefans.com/category/jswz/34/1749693.html style=不要在Ubuntu 20上安装'node"/>

不要在Ubuntu 20上安装'node

我使用webpack4。Windows上的模块正常工作,但在Ubuntu上:

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我尝试输入命令:

sudo npm install -g --unsafe-perm node-sass

>

(node:8310) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
npm WARN deprecated [email protected]: request has been deprecated, see 
/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2725/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] install /usr/local/lib/node_modules/node-sass
> node scripts/install.js

Cached binary found at /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node

> [email protected] postinstall /usr/local/lib/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
/snap/node/2725/bin/node: symbol lookup error: /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE
npm WARN You are using a pre-release version of node and things may not work as expected

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

但是问题不要离开我。谢谢!

回答如下:

位于/root/.npm/node-sass/4.14.1/linux-x64-83_binding.node的缓存二进制文件二进制文件位于/usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node测试二进制文件

我想说的问题[[可能]是事实,它使用的是升级到Ubuntu 20之前的缓存版本,在这种情况下,删除缓存的二进制文件可以解决此问题。

    https://docs.npmjs/cli-commands/cache.html

  • 这只是我的假设,到目前为止,您已尝试解决什么问题?
  • 更多推荐

    不要在Ubuntu 20上安装'node

    本文发布于:2024-05-07 10:28:05,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1755828.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:不要在   Ubuntu   node

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!