E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj>ionic serve -l
(node:4772) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
There is an error in your gulpfile:
Error: Node Sass does not yet support your current environment: Windows 64-bit with false
For more information on which environments are supported please see:
TODO URL
at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\node-sass\lib\index.js:12:11)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\gulp-sass\index.js:187:21)
at Module._compile (module.js:541:32)
当前回答
在我的例子中,这与节点版本有关。
我的项目使用的是12.18.3,但我使用的是14.5.0
所以npm rebuild node-sass没有在错误的节点版本(14.5.0)上解决这个问题。
我切换到正确的版本(12.18.3),所以它可以工作。
其他回答
这条错误消息并不是Ionic的问题,而是node-sass的问题,node-sass是在Gulp文件中指定执行的。
node-sass错误:
Node Sass还不支持当前环境
指示您试图运行的node-sass版本与已安装的node版本不兼容。
查看Node - Sass发布说明,了解您拥有的Node - Sass版本,了解需要哪个版本的Node。
如果node的版本错误,则必须降级node或升级node-sass,直到有兼容的对为止。如果节点版本被支持,你可能只需要运行:
npm rebuild node-sass
(如果全局安装node-sass,则使用-g)。
如果这不起作用,你可以:
npm uninstall node-sass && npm install node-sass
(同样,必要时使用-g)。
这个github问题有很多关于这方面的信息。
我把npm从6.4.12升级到7.14.0,这个错误消失了。然后我得到了另一个错误
错误:节点Sass版本5.0.0与^4.0.0不兼容。
我在这里找到了解决办法。我卸载了node sass 5.0.0并安装了4.14.1(显然这是node sass的最新4个版本,使用npm view node-sass versions命令进行了验证)。
这给了我一卡车的错误。 NPM安装node-sass@
4.14.1npm ERR! code 1
npm ERR! path /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
.. 2000 lines of Err ..
npm ERR! gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /home/<username>/.npm/_logs/2021-05-25T13_09_09_655Z-debug.log
然后我尝试了npm审计fix -force
就会得到这个错误
npm WARN audit No fix available for cp-cli@*
npm ERR! code ETARGET
npm ERR! notarget No matching version found for object-path@1.1.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
我检查了我的包裹。Json中有object-path: "0.11.4"
然后我尝试了npm install node-sass@4.0.0
在Ubuntu 20.04上,这个问题基本上陷入了地狱。我不应该升级到Ubuntu 20.04。
我会继续努力,并在这里报告我的发现。我有信心解决这个问题。
编辑 我将npm从7.14.0降级到6.14.12,npm start现在报告错误:Node Sass版本6.0.0与^4.0.0不兼容。我检查了npm node_sass -v报告6.14.12。我运行npm uninstall node-sass和npm install node-sass@4.14.1。
binding.target.mk:133: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: *** [Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/<subfolder>/commonreact/node_modules/node-sass/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/<subfolder>/commonreact/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:365:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 4.15.0-143-generic
gyp ERR! command "/home/<subfolder>/.nvm/versions/node/v16.2.0/bin/node" "/home/<subfolder>/commonreact/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
gyp ERR! node -v v16.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-class-static-block@7.14.3 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/pickers@3.2.10 requires a peer of @date-io/core@^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
立即编辑工作 我遵循了这里的步骤,然后
节点-v -> 16.something
NVM install lts/erbium ->设置节点为12.22.1
NPM卸载node-sass
NPM安装node-sass@4.14.0
这个方法奏效了
我得到这个错误时,我更新节点使用NVM。 去掉这条线; NPM重建node-sass
试试这个:
npm --depth 9999 update
npm rebuild node-sass
如果你有一个用节点8构建的旧项目,你必须在节点8下运行:
$npm rebuild node-sass
然后切换到10号或以上节点,执行以下命令:
$npm uninstall node-sass && npm install node-sass
在这些行动之后,我一切都很好。如果我在节点8或节点10或更高的节点下执行此操作,则不会修复项目中的问题。 也许它会帮助别人:)
推荐文章
- npm犯错!代码UNABLE_TO_GET_ISSUER_CERT_LOCALLY
- 你可以为你的组织托管一个私有的存储库来使用npm吗?
- 如何用npm更新TypeScript到最新版本?
- Nodejs无法在Windows上找到已安装的模块
- 我需要两个包锁吗?Json和package.json?
- 在Windows上运行Python以获得Node.js依赖
- 如何在NPM安装期间使用不同版本的python ?
- 更新包。Json自动版本
- 无法运行我的Node.js Typescript项目TypeError [ERR_UNKNOWN_FILE_EXTENSION]:未知的文件扩展名"。/app/src/ app .ts
- npm install -g less does not work: EACCES:权限被拒绝
- 为什么在npm中对插件使用对等依赖?
- “npm config set registry https://registry.npmjs.org/”在Windows bat文件中不工作
- 安装Gulp后:"没有命令' Gulp ' found "
- 如何使用私人Github回购作为npm依赖
- NPM在package.json中通过依赖项安装私有github存储库