code

'node-sass'모듈을 찾을 수 없음의 오류

codestyles 2020. 8. 17. 08:56
반응형

'node-sass'모듈을 찾을 수 없음의 오류


구성 : macOS High Sierra, 버전 10.13.2, node : v8.1.2 npm : 5.0.3 angularjs 프로젝트에서 npm start를 실행하면 다음 오류가 발생합니다.

ERROR in Cannot find module 'node-sass'

이 후 나는 다음을 실행합니다.

npm i node-sass

이제이 오류가 발생합니다.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1

npm이 node-sass를 설치하지 않는 이유는 무엇입니까? node-sass를 어떻게 설치할 수 있습니까?


해결책은 다음과 같습니다.

sudo npm install --save-dev  --unsafe-perm node-sass

즐겨!

이것이 작동하지 않으면 미러에서 설치하십시오

npm install -g mirror-config-china --registry = http://registry.npm.taobao.org npm install node-sass


  1. 이 오류는 node-sass가 없습니다 ...이 문제를 해결하려면 다음 명령을 실행하십시오.

npm install node-sass


운영:

npm rebuild node-sass --force              

잘 작동합니다.


그런 npm uninstall node-sass다음 npm i node-sass나를 위해 일하지 않았습니다.

나를 위해 일한 솔루션은 npm install --save-dev node-sass.

해피 코딩 ..


그것은 나를 위해 일했습니다 ...

sudo npm rebuild node-sass --force

보유한 네트워크로 인해 npm 종속성을 다운로드하는 데 문제가 있습니다. 개방형 네트워크에서 npm 종속성을 다운로드하십시오. 당신은 어떤 문제도 얻지 못할 것입니다. 나는 또한이 비슷한 문제에 직면하고 마침내 해결되었습니다.

아래 명령을 사용하십시오 : npm install (모든 종속성을 다운로드합니다) npm start angular 응용 프로그램을 시작하십시오


내 로컬 컴퓨터에서 노드 버전을 확인했습니다 v10.11.0.

그런 다음 오류가 발생한 개발 머신을 확인했을 때 Node version V.10.8.0.

v10.11.0내 개발 컴퓨터에서 Node를 업그레이드 하면 문제가 해결되었습니다.

도움이 되었기를 바랍니다.


그 중 하나는 설치 후 프로세스가 실패하는 것입니다. node-sass가 설치된 직후 설치 후 스크립트가 실행됩니다. 해당 프로세스를 위해서는 Python 및 C ++ 빌더가 필요합니다. 로그 'gyp : Xcode 또는 CLT 버전이 감지되지 않았습니다!' C ++ 빌더를 찾을 수 없기 때문일 수 있습니다. 따라서 Python 및 C ++ 빌더를 설치 한 다음 npm이 찾을 수 있도록 환경 변수에 해당 디렉토리를 넣으십시오. (저는 Windows에서 왔습니다)


npm install node-sass 누락 된 sass npm 종속성 모듈이 존재하지 않거나 이전에 충돌 한 버전을 덮어 쓰기 때문에 대부분의 경우 작업을 수행합니다.

Mac 사용자의 경우 sudo위의 명령 앞에 사용하십시오 .

Windows 시스템 npm rebuild node-sass --force에서는 기본적으로 "npm이 강제로 sass 노드 모듈을 다시 빌드하도록 요청하기"때문에 일부 사용자에게는 작동하지 않을 수 있습니다. 해당 모듈이 없기 때문에 작동하지 않습니다.

npm install초기 설치를 할 때마다 sass 모듈이 설치되지 않았기 때문에이 문제가 발생합니다.


Microsoft Visual Studio Code의 통합 git 터미널을 사용하는 동안이 오류가 발생했습니다. 이상한 이유 때문에 VS 코드가 'node-sass'를 설치하는 것을 허용하지 않았습니다. 그런 다음 'Git Bash'(git과 함께 설치됨)를 사용하고 다음 명령을 실행 npm install node-sass했습니다. 왜 그리고 어떻게 작동했는지 모르겠습니다. 누구든지 설명이 있으면 알려주십시오.


프로젝트를 실행하려고 할 때 비슷한 문제가 발생했습니다. 먼저 현재 버전을 제거했습니다.

npm uninstall node-sass

그런 다음 최신 버전으로 다시 설치했습니다.

npm install node-sass

node-sass 가 설치되지 않고 있으며 여러 이유 중 하나 일 수 있습니다.

설치하지 않았습니다.

npm install node-sass --save-dev

권한 오류가 있습니다.

sudo npm install --save-dev  --unsafe-perm node-sass

메모리 문제가 발생했습니다 (플랫폼의 c 코드에서 빌드). 이것은 일부 플랫폼 및 노드 버전에 적용됩니다.

node --max_old_space_size=8000 $(which npm) install node-sass --save-dev

노드와 npm 버전이 호환되지 않습니다. 대부분 빌드 프로세스에서 오류가 발생했을 가능성이 높습니다.

이 경우 n 또는 nvm을 사용하여 새 환경과 원래 환경, 작동했던 환경에서 동일한 버전을 가지고 있는지 확인하십시오. 일반적으로 다른 환경에서 다른 버전을 사용하기 때문입니다.


It failed for me because I was using the latest version of node (12.7.0) I then had to explicitly install the latest version of node-sass with:

npm install node-sass@4.12.0


According to node-sass github page, supported node.js version vary release by release.

https://github.com/sass/node-sass

enter image description here

Example: Check the version of node you are running.

node -v
-> v12.0.0

you need node-sass v4.12+. so you can

npm install node-sass@4.12.0

or if 4.12.0 is the latest

npm install node-sass@latest

(npm install node-sass will install the latest version in many cases, but remember that it does not always install the latest(in this example 4.12.0) if dependency in package.json is written like ^3.0.0, ~4.11.0) What's the difference between tilde(~) and caret(^) in package.json?

Lastly, using sudo with npm is not a good practice. Please refer to this article. https://medium.com/@ExplosionPills/dont-use-sudo-with-npm-still-66e609f5f92


If you run

npm install node-sass

and it still doesn't work remember to change permission to folder


I have also been facing this error. None of the above methods work for me. Please follow this as it worked for me.

For Installing node-sass in Ubuntu 16 via npm :-

You can install with npm 5.2.0 Version

If you are using nvm :-

nvm install 8.2.1
nvm use 8.2.1
npm install node-sass

If you are using npm separately then upgrade or downgrade npm version to 5.2.0

npm install node-sass

You should try to check the log generated by npm install.

I have faced the same issues, and I found the error that python2 is not found in the path (environment variable).

After installing Python, everything worked fine.


In my case I had to also had to perform:

npm install sass-loader

To fix the problem


Upgrading to latest version of nodeJS solved my problem


I've fixed this problem by installing v10.16.10 node version.


npm install --save-dev --unsafe-perm node-sass

This will do magic, you can use it with sudo


just run this command in terminal, it will install latest version of node-sass

npm install node-sass


What fixed it for me was installing the latest version of node-sass, in this case 4.7.2.

참고URL : https://stackoverflow.com/questions/48147896/error-in-cannot-find-module-node-sass

반응형