Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm i 异常 #1

Closed
lianlianyi opened this issue Jan 2, 2022 · 2 comments
Closed

npm i 异常 #1

lianlianyi opened this issue Jan 2, 2022 · 2 comments

Comments

@lianlianyi
Copy link

npm ERR! code 1
npm ERR! path /Users/npc/github/react-amis-admin/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'request'
npm ERR! Require stack:
npm ERR! - /Users/npc/github/react-amis-admin/node_modules/node-sass/scripts/install.js
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR! at require (node:internal/modules/cjs/helpers:102:18)
npm ERR! at Object. (/Users/npc/github/react-amis-admin/node_modules/node-sass/scripts/install.js:10:13)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! '/Users/npc/github/react-amis-admin/node_modules/node-sass/scripts/install.js'
npm ERR! ]
npm ERR! }

@iceqing
Copy link
Owner

iceqing commented Jan 2, 2022

可以提供下以下环境信息吗?

  1. node版本
  2. npm版本
  3. 操作系统版本

猜测可能跟node-sass版本不兼容有关

目前我编译通过的环境是:
node版本是v14.18.2
npm版本是6.14.15

下面是node版本与node-sass版本的兼容性表格,可以根据node版本切换node-sass版本试试:

image

图片来源:https://github.com/sass/node-sass

@iceqing
Copy link
Owner

iceqing commented Jan 2, 2022

node-sass在不同环境下确实容易出现问题,已经从node-sass迁移到了dart-sass,可以重新拉取master执行npm i

而且dart-sass现在是官方推荐的,性能更快,兼容性更好。

参考:https://sass-lang.com/dart-sass

@iceqing iceqing closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants