Содержание
- How to fix error “cannot find module gulp-sass” in Gulp
- Check your node_modules folder
- Install the gulp-sass module manually
- Delete and reinstall all npm packages
- Ошибка: не удается найти модуль ‘gulp -sass’
- ОТВЕТЫ
- Ответ 1
- Ответ 2
- Ответ 3
- Ответ 4
- Ответ 5
- Ответ 6
- Ответ 7
- Ответ 8
- Ответ 9
- Ответ 10
- I can’t install gulp-sass. Error: Cannot find module ‘gulp-sass’ #2619
- Comments
How to fix error “cannot find module gulp-sass” in Gulp
When you’re running Gulp, you might see an error that says something like “cannot find module gulp-sass”.
This error message means that Gulp is trying to run a function from the gulp-sass package, but it can’t locate it.
If you’re getting this annoying error, here are a few fixes that you can use to get rid of it.
Check your node_modules folder
When you install npm packages, npm will create a node_modules folder in your project root. It will also add packages you’ve installed to your package.json and package-lock.json files.
You can confirm that a package has been installed by making sure it’s listed in your package and package-lock.json files. And double-check your node_modules folder to make sure the package is in a subfolder there.
Lastly, make sure you are running your website or web app from the project root folder, and that the root folder contains the node_modules folder as a direct subfolder. If the node_modules folder isn’t in that location, it may cause this error.
Install the gulp-sass module manually
If you don’t see the gulp-sass package in your node_modules folder, or are still having issues, you can try reinstalling the package.
First, open your package.json and package-lock.json files and remove any references to gulp-sass and node-sass that you see. This will make sure that you will reinstall the most up-to-date version of the packages.
The line to delete in order to remove the gulp-sass package from your package.json file.
The lines to delete the gulp-sass package from your package-lock.json file.
Then, run npm install gulp-sass or npm install gulp-sass —save-dev to install and save in package.json file. Adding the —save-dev flag will add packages to the devDependencies section of your package.json file.
If you don’t add the flag it will get added to the dependencies section of the file. Especially if you’re just working locally, it doesn’t matter a ton which section you use, so follow your own preferences on this.
Note that this will install the package locally in your project folder, and the package will be accessible only from that project. You can also install packages globally on your computer, so that they are accessible from any other directory.
You can do this by adding the global ( -g ) flag to the install command, like this: npm install -g gulp-sass .
However I usually install packages local to the project. I do install the gulp-cli globally, but everything else I just keep local.
Delete and reinstall all npm packages
If just removing and reinstalling just the gulp-sass package doesn’t work, you can try deleting and reinstalling all your npm packages.
First, make sure that all the packages you need in your project exist in your package.json file. Also make sure that gulp-sass exists in your package.json file.
Then, delete your node_modules folder. You can do this by deleting from your file explorer, or running rm node_modules in the command line. If you encounter errors or difficulties deleting the folder, you can try installing an npm package called rimraf that helps with deleting.
I install rimraf globally on my computer so I can run it from any directory. You can install rimraf globally by running npm install -g rimraf . Then you can attempt to delete the folder by running rimraf node_modules from the project root command line.
If you still have issues or get an error like node_modules@types is not accessible you may need to first close VS Code or whichever code editor you are using. Then try deleting the folder again.
Once you have successfully deleted the node_modules folder, run npm install from your project root to install all the packages you have listed.
I’m making a course that will teach you how to build a real-world responsive website from scratch!
Sign up to get emails about new posts and other info. Unsubscribe anytime.
Affiliate Disclaimer
I participate in various affiliate programs and my content contains affiliate links. If you purchase through those links, I may receive a commission from the seller, at no cost to yourself. It’s one way you can support this site!
As an Amazon Associate I earn from qualifying purchases. I only recommend products that I personally know and believe are helpful to my readers.
Источник
Ошибка: не удается найти модуль ‘gulp -sass’
Когда я компилирую с gulp , я получаю сообщение об ошибке, как показано ниже. Как я могу это исправить?
ОТВЕТЫ
Ответ 1
Просто сделайте npm update , а затем npm install gulp-sass —save-dev в корневой папке, а затем, когда вы запустите, вы не должны иметь никаких проблем.
Ответ 2
Вы проверили этот вопрос?
Ответ 3
Отредактируйте ваш package.json. Изменить:
Удалите папку node_modules и снова запустите npm install .
Ответ 4
У меня была та же проблема, и я решил сделать это npm update . Но я получаю сообщение о разрешении, поэтому я запускаю:
Этот набор разрешений для моего пользователя запускает команды npm, такие как администратор. Затем я запускаю это снова:
Тогда моя проблема с этим была решена.
Ответ 5
У меня была такая же проблема на моем новом компьютере с Windows 10. Мне пришлось использовать инструменты сборки Windows с помощью npm install -g windows-build-tools . (https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration)
Ответ 6
Ответ 7
я также столкнулся с той же проблемой, возможное решение состоит в том, чтобы установить модуль npm install -g gulp-sass , но если вы запустите npm install -g gulp-sass команду: npm install -g gulp-sass или npm install —save gulp-sass , это не будет быть обновленным в конце проекта sass-node.
Эта версия node-sass отсутствует (возвращает 404) и Google Web-Starter-Kit v0.6.5 зависел от него в течение длительного времени, с декабря 2016 года. Таким образом, он работал в течение длительного времени и должен иметь только исчез.
Ошибка HTTP 404 Не найдено
Единственный обходной путь — обновить node-sass: npm я [email protected] —save-dev чтобы исправить проблему.
Ответ 8
В корневой папке, где находится package.json , запустите npm outdated . Вы получите устаревшие пакеты с некоторыми подробностями. В этих деталях вы увидите номер текущей версии устаревшего пакета.
После этого откройте файл package.json и вручную измените номер версии соответствующего пакета.
Затем удалите папку node_modules и запустите npm install . Это должно решить эту проблему.
Ответ 9
У меня была такая же ошибка на Ubuntu 18.04
Удалите папку node_modules и запустите
Ответ 10
У меня была эта проблема в течение нескольких дней, ища ответы. Мой журнал ошибок был похож на этот npm просто не установит node sass Единственной проблемой была версия node. Возможно, это может помочь некоторым из вас.
Источник
I can’t install gulp-sass. Error: Cannot find module ‘gulp-sass’ #2619
- NPM version ( npm -v ):
- Node version ( node -v ):
- Node Process ( node -p process.versions ):
- Node Platform ( node -p process.platform ):
- Node architecture ( node -p process.arch ):
- node-sass version ( node -p «require(‘node-sass’).info» ):
- npm node-sass versions ( npm ls node-sass ):
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ sudo npm install gulp —save-dev
Password:
fsevents@1.2.7 install /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node install
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@11.12.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib’
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command «/usr/local/bin/node» «/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js» «configure» «—fallback-to-build» «—module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node» «—module_name=fse» «—module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64» «—napi_version=4» «—node_abi_napi=napi»
gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:988:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command «/usr/local/bin/node» «/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp» «install» «—fallback-to-build»
node-pre-gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node-pre-gyp ERR! node -v v11.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
- gulp@4.0.0
added 316 packages from 216 contributors and audited 6374 packages in 73.882s
found 0 vulnerabilities
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ gulp -v
[18:15:44] CLI version 2.0.1
[18:15:44] Local version 4.0.0
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ ls
README.md gulpfile.js index.html package-lock.json scss
_assets images node_modules package.json
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ sudo npm i gulp-sass -D
Password:
fsevents@1.2.7 install /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node install
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@11.12.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib’
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command «/usr/local/bin/node» «/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js» «configure» «—fallback-to-build» «—module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node» «—module_name=fse» «—module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64» «—napi_version=4» «—node_abi_napi=napi»
gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:988:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command «/usr/local/bin/node» «/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp» «install» «—fallback-to-build»
node-pre-gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node-pre-gyp ERR! node -v v11.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
node-sass@4.11.0 install /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
node scripts/install.js
Unable to save binary /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor/darwin-x64-67 : < Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor’
at Object.mkdirSync (fs.js:773:3)
at sync (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/scripts/install.js:114:11)
at Object. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path:
‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor’ >
node-sass@4.11.0 postinstall /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
node scripts/build.js
Building: /usr/local/bin/node /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js rebuild —verbose —libsass_ext= —libsass_cflags= —libsass_ldflags= —libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ ‘/usr/local/bin/node’,
gyp verb cli ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js’,
gyp verb cli ‘rebuild’,
gyp verb cli ‘—verbose’,
gyp verb cli ‘—libsass_ext=’,
gyp verb cli ‘—libsass_cflags=’,
gyp verb cli ‘—libsass_ldflags=’,
gyp verb cli ‘—libsass_library=’ ]
gyp info using node-gyp@3.8.0
gyp info using node@11.12.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing «build» directory
gyp verb command configure []
gyp verb check python checking for Python executable «python2» in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb which failed python2 < Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb which failed stack:
gyp verb which failed ‘Error: not found: python2n at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)n at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)n at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5n at FSReqCallback.oncomplete (fs.js:158:21)’,
gyp verb which failed code: ‘ENOENT’ >
gyp verb check python checking for Python executable «python» in the PATH
gyp verb which succeeded python /usr/bin/python
gyp verb check python version /usr/bin/python -c «import sys; print «2.7.10 gyp verb check python version .%s.%s» % sys.version_info[:3];» returned: %j
gyp verb get node dir no —target version specified, falling back to host node version: 11.12.0
gyp verb command install [ ‘11.12.0’ ]
gyp verb install input version string «11.12.0»
gyp verb install installing version: 11.12.0
gyp verb install —ensure was passed, so won’t reinstall if already installed
gyp verb install version is already installed, need to check «installVersion»
gyp verb got «installVersion» 9
gyp verb needs «installVersion» 9
gyp verb install version is good
gyp verb get node dir target node version installed: 11.12.0
gyp verb build dir attempting to create «build» dir: /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command «/usr/local/bin/node» «/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js» «rebuild» «—verbose» «—libsass_ext=» «—libsass_cflags=» «—libsass_ldflags=» «—libsass_library=»
gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall 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:
npm ERR! /Users/marylapieroszkiewicz/.npm/_logs/2019-03-20T17_31_07_796Z-debug.log
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ gulp sass
internal/modules/cjs/loader.js:651
throw err;
^
Error: Cannot find module ‘gulp-sass’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
at Function.Module._load (internal/modules/cjs/loader.js:575:25)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/gulpfile.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ gulp
internal/modules/cjs/loader.js:651
throw err;
^
Error: Cannot find module ‘gulp-sass’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
at Function.Module._load (internal/modules/cjs/loader.js:575:25)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/gulpfile.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ sudo npm install —save-dev gulp-sass
Password:
fsevents@1.2.7 install /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node install
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@11.12.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib’
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command «/usr/local/bin/node» «/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js» «configure» «—fallback-to-build» «—module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node» «—module_name=fse» «—module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64» «—napi_version=4» «—node_abi_napi=napi»
gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:988:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command «/usr/local/bin/node» «/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp» «install» «—fallback-to-build»
node-pre-gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents
node-pre-gyp ERR! node -v v11.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure —fallback-to-build —module=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node —module_name=fse —module_path=/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 —napi_version=4 —node_abi_napi=napi’ (1)
node-sass@4.11.0 install /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
node scripts/install.js
Unable to save binary /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor/darwin-x64-67 : < Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor’
at Object.mkdirSync (fs.js:773:3)
at sync (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/scripts/install.js:114:11)
at Object. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path:
‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/vendor’ >
node-sass@4.11.0 postinstall /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
node scripts/build.js
Building: /usr/local/bin/node /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js rebuild —verbose —libsass_ext= —libsass_cflags= —libsass_ldflags= —libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ ‘/usr/local/bin/node’,
gyp verb cli ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js’,
gyp verb cli ‘rebuild’,
gyp verb cli ‘—verbose’,
gyp verb cli ‘—libsass_ext=’,
gyp verb cli ‘—libsass_cflags=’,
gyp verb cli ‘—libsass_ldflags=’,
gyp verb cli ‘—libsass_library=’ ]
gyp info using node-gyp@3.8.0
gyp info using node@11.12.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing «build» directory
gyp verb command configure []
gyp verb check python checking for Python executable «python2» in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb which failed python2 < Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb which failed stack:
gyp verb which failed ‘Error: not found: python2n at getNotFoundError (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:13:12)n at F (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:68:19)n at E (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:80:29)n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/which/which.js:89:16n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/index.js:42:5n at /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/isexe/mode.js:8:5n at FSReqCallback.oncomplete (fs.js:158:21)’,
gyp verb which failed code: ‘ENOENT’ >
gyp verb check python checking for Python executable «python» in the PATH
gyp verb which succeeded python /usr/bin/python
gyp verb check python version /usr/bin/python -c «import sys; print «2.7.10 gyp verb check python version .%s.%s» % sys.version_info[:3];» returned: %j
gyp verb get node dir no —target version specified, falling back to host node version: 11.12.0
gyp verb command install [ ‘11.12.0’ ]
gyp verb install input version string «11.12.0»
gyp verb install installing version: 11.12.0
gyp verb install —ensure was passed, so won’t reinstall if already installed
gyp verb install version is already installed, need to check «installVersion»
gyp verb got «installVersion» 9
gyp verb needs «installVersion» 9
gyp verb install version is good
gyp verb get node dir target node version installed: 11.12.0
gyp verb build dir attempting to create «build» dir: /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command «/usr/local/bin/node» «/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-gyp/bin/node-gyp.js» «rebuild» «—verbose» «—libsass_ext=» «—libsass_cflags=» «—libsass_ldflags=» «—libsass_library=»
gyp ERR! cwd /Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/node_modules/node-sass
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall 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:
npm ERR! /Users/marylapieroszkiewicz/.npm/_logs/2019-03-21T09_32_32_941Z-debug.log
Mary-Pieroszkiewiczs-MacBook-Pro:GOGOmedia____Recruitment__Task marylapieroszkiewicz$ sudo gulp
internal/modules/cjs/loader.js:651
throw err;
^
Error: Cannot find module ‘gulp-sass’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
at Function.Module._load (internal/modules/cjs/loader.js:575:25)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/Users/marylapieroszkiewicz/Desktop/GOGOmedia____Recruitment__Task/gulpfile.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
The text was updated successfully, but these errors were encountered:
Источник
When you’re running Gulp, you might see an error that says something like “cannot find module gulp-sass”.
This error message means that Gulp is trying to run a function from the gulp-sass package, but it can’t locate it.
If you’re getting this annoying error, here are a few fixes that you can use to get rid of it.
Check your node_modules folder
When you install npm packages, npm will create a node_modules
folder in your project root. It will also add packages you’ve installed to your package.json
and package-lock.json
files.
You can confirm that a package has been installed by making sure it’s listed in your package
and package-lock.json
files. And double-check your node_modules
folder to make sure the package is in a subfolder there.
Lastly, make sure you are running your website or web app from the project root folder, and that the root folder contains the node_modules
folder as a direct subfolder. If the node_modules
folder isn’t in that location, it may cause this error.
Install the gulp-sass module manually
If you don’t see the gulp-sass
package in your node_modules
folder, or are still having issues, you can try reinstalling the package.
First, open your package.json
and package-lock.json
files and remove any references to gulp-sass
and node-sass
that you see. This will make sure that you will reinstall the most up-to-date version of the packages.
Then, run npm install gulp-sass
or npm install gulp-sass --save-dev
to install and save in package.json
file. Adding the --save-dev
flag will add packages to the devDependencies
section of your package.json
file.
If you don’t add the flag it will get added to the dependencies
section of the file. Especially if you’re just working locally, it doesn’t matter a ton which section you use, so follow your own preferences on this.
Note that this will install the package locally in your project folder, and the package will be accessible only from that project. You can also install packages globally on your computer, so that they are accessible from any other directory.
You can do this by adding the global (-g
) flag to the install
command, like this: npm install -g gulp-sass
.
However I usually install packages local to the project. I do install the gulp-cli
globally, but everything else I just keep local.
Delete and reinstall all npm packages
If just removing and reinstalling just the gulp-sass
package doesn’t work, you can try deleting and reinstalling all your npm packages.
First, make sure that all the packages you need in your project exist in your package.json
file. Also make sure that gulp-sass
exists in your package.json
file.
Then, delete your node_modules
folder. You can do this by deleting from your file explorer, or running rm node_modules
in the command line. If you encounter errors or difficulties deleting the folder, you can try installing an npm package called rimraf that helps with deleting.
I install rimraf globally on my computer so I can run it from any directory. You can install rimraf globally by running npm install -g rimraf
. Then you can attempt to delete the folder by running rimraf node_modules
from the project root command line.
If you still have issues or get an error like node_modules@types is not accessible
you may need to first close VS Code or whichever code editor you are using. Then try deleting the folder again.
Once you have successfully deleted the node_modules
folder, run npm install
from your project root to install all the packages you have listed.
Want to learn how to build a website?
I’m making a course that will teach you how to build a real-world responsive website from scratch!
Learn more
Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my react app But unfortunatly it cant find sass module here is error that I am facing off Cannot find module ‘sass’ in reactjs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
Contents
- How Cannot find module ‘sass’ in reactjs Error Occurs ?
- How To Solve Cannot find module ‘sass’ in reactjs Error ?
- Solution 1
- Summary
How Cannot find module ‘sass’ in reactjs Error Occurs ?
I am trying to run my react app But unfortunatly it cant find sass module here is error that I am facing off.
Cannot find module 'sass'
Require stack:
How To Solve Cannot find module ‘sass’ in reactjs Error ?
- How To Solve Cannot find module ‘sass’ in reactjs Error ?
To Solve Cannot find module ‘sass’ in reactjs Error You just need to globally install sass module with this plugin. First of all you need to forcefully clear your cache with this plugin: npm cache clear –force Now, You have to install sass module with this command: npm install sass Now, your error must be solved.
- Cannot find module ‘sass’ in reactjs
To Solve Cannot find module ‘sass’ in reactjs Error Here
node-sass
is deprecated as by now! Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass. So that You just need to globally install sass module with this plugin. First of all you need to forcefully clear your cache with this plugin. Now, your error must be solved.
Solution 1
Here node-sass
is deprecated as by now! Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.
So that You just need to globally install sass module with this plugin. First of all you need to forcefully clear your cache with this plugin.
npm cache clear --force
Now, You have to install sass module with this command.
npm install sass
OR Install sass
Globally
npm i -g sass
or Locally
npm i sass --save-dev
Now, your error must be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- How to add SCSS styles to a React project?
Когда я компилирую с gulp
, я получаю сообщение об ошибке, как показано ниже. Как я могу это исправить?
module.js:339
throw err;
^
Error: Cannot find module 'gulp-sass'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/flyscoot.com/gulpfile.js:2:12)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
Ответ 1
Просто сделайте npm update
, а затем npm install gulp-sass --save-dev
в корневой папке, а затем, когда вы запустите, вы не должны иметь никаких проблем.
Ответ 2
Вы проверили этот вопрос?
Возможное решение:
rm -rf node_modules/
npm install
Ответ 3
Отредактируйте ваш package.json. Изменить:
"gulp-sass": "^2.3.2"
в
"gulp-sass": "3.0.0"
Удалите папку node_modules и снова запустите npm install
.
Источник: https://github.com/codecombat/codecombat/issues/4430#issuecomment-348927771
Ответ 4
У меня была та же проблема, и я решил сделать это npm update
. Но я получаю сообщение о разрешении, поэтому я запускаю:
sudo chwon -R myuser /home/myUserFolder/.config
Этот набор разрешений для моего пользователя запускает команды npm, такие как администратор. Затем я запускаю это снова:
npm update
и это:
npm install gulp-sass
Тогда моя проблема с этим была решена.
Ответ 5
У меня была такая же проблема на моем новом компьютере с Windows 10. Мне пришлось использовать инструменты сборки Windows с помощью npm install -g windows-build-tools
. (https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration)
Ответ 6
Попробуй это:
npm install -g gulp-sass
или же
npm install --save gulp-sass
Ответ 7
я также столкнулся с той же проблемой, возможное решение состоит в том, чтобы установить модуль npm install -g gulp-sass
, но если вы запустите npm install -g gulp-sass
команду: npm install -g gulp-sass
или npm install --save gulp-sass
, это не будет быть обновленным в конце проекта sass-node.
Эта версия node-sass отсутствует (возвращает 404) и Google Web-Starter-Kit v0.6.5 зависел от него в течение длительного времени, с декабря 2016 года. Таким образом, он работал в течение длительного времени и должен иметь только исчез.
Загрузка двоичного файла с https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node Невозможно загрузить » https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node «:
Ошибка HTTP 404 Не найдено
Единственный обходной путь — обновить node-sass: npm я [email protected] --save-dev
чтобы исправить проблему.
Ответ 8
В корневой папке, где находится package.json
, запустите npm outdated
. Вы получите устаревшие пакеты с некоторыми подробностями. В этих деталях вы увидите номер текущей версии устаревшего пакета.
После этого откройте файл package.json
и вручную измените номер версии соответствующего пакета.
Затем удалите папку node_modules
и запустите npm install
. Это должно решить эту проблему.
Ответ 9
У меня была такая же ошибка на Ubuntu 18.04
Удалите папку node_modules и запустите
sudo npm install --unsafe-perm=true
Ответ 10
У меня была эта проблема в течение нескольких дней, ища ответы. Мой журнал ошибок был похож на этот npm просто не установит node sass
Единственной проблемой была версия node. Возможно, это может помочь некоторым из вас.
Я понизил мои Node.js с 9.3.0 до 6.12.2 и запустил:
npm update
Ответ 11
Те, кто получает эту ошибку, пожалуйста, понизьте версию Node.js, которую вы используете.
-
Шаг 1 :
Удалите тот, который вы используете, и установите версию, которую вы предпочитаете. Я установил v6.12.3. Моя предыдущая версия Node.js была v9.4.0.
-
Шаг 2 :
Загрузите Node.js.
Надеюсь, это сработает.
Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Posted May 16, 2016 3:02pm by Jessie Gibson
When I try and run the
gulp compileSass
in terminal in the Gulp Basics compiling Sass I continue to get this error and I am not sure what to do. I have tried updating gulp-sass, installing node-sass, etc..
3 Answers
Jessie Gibson May 16, 2016 3:21pm
Nevermind, I figured it out. I had this
instead of
sass = require('gulp-sass');
Problem solved
PLUS
Hi Jessie,
What error are you getting?
Jessie Gibson May 16, 2016 3:14pm
Oops… This is the error that I am getting
module.js:338
throw err; ^ Error: Cannot find module 'sass' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/Users/jessiegibson/Dropbox/webdev/treehouse-gulp-basics/gulpfile.js:7:10) at Module._compile (module.js:430:26) at Object.Module._extensions..js (module.js:448:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17)