【发布时间】:2022-02-13 14:08:22
【问题描述】:
我有一个简单的 next.js 项目,我是按照他们的教程创建的。它在我的 Windows 开发机器上构建和运行良好。
我想在 Ubuntu 18.04.02 LTS 上部署它,但是当我克隆 git 项目并运行 npm install 时,它无法安装 node-sass,并显示以下错误消息:
> node-sass@4.12.0 install /var/www/example.com/beta/node_modules/node-sass
> node scripts/install.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module '/var/www/example.com/beta/node_modules/node-sass/scripts/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: ...
这是log file 的要点。请参阅错误的最后几行(我已包含整个文件,以防有其他有用的信息)。
我的 NodeJS 版本是 10.15.3,我的 NPM 版本是 6.4.1。我不确定如何在 Ubuntu 上运行 next.js 项目。
【问题讨论】:
标签: node.js npm ubuntu-18.04 node-sass