When try to ember build or ember serve I get next error:
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with:
Error: ENOENT: no such file or directory, stat
'/Users/artem_shevtsov/DATA/Projects/laser/ui/tmp/source_map_concat-input_base_path-TNdPSywn.tmp/bower_components/foundation-sites/dist/foundation.js'
at Object.fs.statSync (fs.js:906:18)
at FSMonitor._measure (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:66:21)
at Object.statSync (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:82:30)
at Concat.keyForFile (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:87:20)
at Array.map (native)
at Concat.CachingWriter._conditionalBuild (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:109:65)
at /Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-plugin/read_compat.js:93:34
at tryCatch (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
I tried npm and bower cache clean, rm -rf tmp node_modules bower_components and plugins reinstallation
Also tried manual installation with npm and bower (npm i foundation-sites, bower install foundation-sites) and add
app.import('node_modules/foundation-sites/dist/js/foundation.js')
app.import('node_modules/foundation-sites/dist/js/foundation.min.js')
(or bower_components/... respectively) but it does not work
❯ npm -v
3.10.9
❯ node -v
v7.2.0
❯ ember -v
v7.2.0
ember-cli: 2.9.0
node: 7.2.0
os: darwin x64
Remove entry for foundation or foundation-sites from package.json and bower.json.
npm cahce clean
bower cache clean
rm -rf tmp node_modules bower_components
npm install && bower install
bower install foundation
remove other entries related foundation from ember-cli-build.js and include below app.import('bower_components/foundation-sites/dist/js/foundation.min.js')
Stop ember server and start it again.
app.import('bower_components/foundation-sites/dist/foundation.min.js', {
type: 'vendor'
});
type: 'vendor' is the secret of success
path can be different, depends on foundation-sites version
I leave package.json and bower.json without any changes
Set the version of foundation-sites to 6.2.2 in bower.json
run bower install
Related
I have cloned a repo from GitHub for a project. I've already installed node (-v 14.17.5) and npm (-v7.20.6), however when I run npm start I get the following code. I've tried reinstalling node and npm several times but I keep getting the same error:
$ npm start
> simplefolio#1.0.1 start
> webpack server --config webpack.dev.js --open
[webpack-cli] You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'webpack-dev-server/bin/cli-flags'
Require stack:
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\#webpack-cli\serve\lib\index.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\bin\cli.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack\bin\webpack.js
Remove node_modules and package-lock.json, then npm i again
Remove node modules, then npm i again
In my case, I have node 16.13.0 and npm 7.20.1. Removing nodes_modules, package-lock.json and run npm cache clean --force alone didn't help. The key change for me is upgrading npm version to the latest (8.7.0), then combining with clean install.
node-sass#2.1.1 install /home/user/Documents/project/node_modules/node-sass
> node scripts/install.js
WARN invalid config loglevel="notice"
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/linux-x64-node-8.2/binding.node
> node-sass#2.1.1 postinstall /home/user/Documents/project/node_modules/node-sass
> node scripts/build.js
module.js:487
throw err;
^
Error: Cannot find module '/home/user/Documents/project/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
Build failed
added 2186 packages in 42.166s
I tried so far:
npm rebuild
npm rebuild node-sass
npm uninstall -g node-sass
rm -rf node_module
Replace node-sass with sass, which is a pure-JS implementation and is less prone to build errors as it doesn't use node-gyp.
npm uninstall node-sass
npm i -D sass
It can then be added to package.json as follows, for example:
{
"scripts": {
"build:css": "sass --style compressed --update src/scss:static/css",
"watch:css": "sass --watch src/scss:static/css",
}
}
You need to do next steps and it should work:
rm -rf node_modules package-lock.json
npm install --saveDev node-sass#4.5.3
npm install
Voila :)
by using yarn run:
yarn add node-sass
Removed package-lock.json, installed Python 2.7, added an env variable for python path.
Ran npm install.
Voila !
node-sass has minimum dependency according to the version of node installed in your system. You can find out the minimum version required here
Use
Node : v14.16.0
node-sass: ^4.14.1
it works for me
This question is old, but if you arrive here in 2022 or later, then this info may be useful:
node-sass is deprecated. Now you should use sass.
That's why the answer given by Usama Muhammad works. Hope this helps.
Sources:
https://www.npmjs.com/package/node-sass
https://www.npmjs.com/package/dart-sass
The minimum version with Node 8 support is 4.5.3. Offhand, I don't think 2.x will support anything above Node 0.12, which is EOL.
Delete package-lock.json
Remove 'node-sass' dependency from your package.json
run npm install
run npm gulp-sass --save-dev
run npm i -d sass
run npm start
I have found I get node-sass errors when trying to install over a corporate proxy. The first solution is to ensure your .npmrc file has proxy allowance.
.npmrc
# Try removing reference to registry, as sometimes your local corporate registry of node_modules may not include node-sass
# // registry=https://....
# note if using special characters in pass, encode them: eg: h#ppy = h%40ppy
strict-ssl=false
proxy=http://<username>:<pass>#proxyhost:<port>
https-proxy=http://<uname>:<pass>#proxyhost:<port>
NODE_TLS_REJECT_UNAUTHORIZED = 0
Then in command line before running any install
set NODE_TLS_REJECT_UNAUTHORIZED = 0
Zip node-binding files from node-sass github site in order to download them over corporate network.
Example:
https://github.com/inspiraller/node-sass-bindings
Add manually in package.json : "node-sass": "4.13.0"
and update package.json in terminal npm install
I am trying to compile webpack configuration files with Laravel Mix.
Following webpack episode on Laracasts Vue 2 series,
// Scripts
"scripts": {
"dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
....
// mix
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.version();
When I run $ npm run dev, I get an error:
npm ERR! Exit status 1
npm ERR! Failed at the # dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
// Running
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
// The error points to
let extractPlugin = new plugins.ExtractTextPlugin(
/Users/User/Code/project/node_modules/laravel-mix/setup/webpack.config.js:126
The issue seems to be update a Node.js dependency: https://github.com/JeffreyWay/laravel-mix/issues/264
How do I update the Node.js dependency?
I am trying:
$ brew upgrade node : Error = node not installed
$ node -v = 2.15.5
$ npm -v = 4.4.5
$ brew install node // installs but throws error
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
brew link --overwrite node
To list all files that would be deleted:
brew link --overwrite --dry-run node
Possible conflicting files are:
/usr/local/bin/node
...
**$ brew upgrade node // says node 7.5.0 already installed**
$ npm run dev // same error
$ node -v = 4.4.5
I also ran $ brew install node which installed, but I got an error:
Error: The brew link step did not complete successfully.
The formula built, but is not symlinked into /usr/local.
Could not symlink bin/node.
Target /usr/local/bin/node
already exists. You may want to remove it:
rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
brew link --overwrite node
To list all files that would be deleted:
brew link --overwrite --dry-run node
you can delete your node modules folder in your laravel project.
after that run :
npm install - g npm
this command will reinstall the node modules folder with upgrading node files.
next, you can try and run
npm run dev
and you can also run
npm update
to update your node
hope this answer will help
Im Using Windows 10
You can Download NVM for node it stands for node version manager
after you set it up, type this to your cmd
nvm version
nvm install node {version of node you want}
nvm use {version of node}
hope this works for you
because it works for me
I installed Node.js again from nodejs.org, rewriting old files.
However this actually downgraded npm from 4.4.5 to 4.1.2... Node.js was 2.15.5 and is now 7.5.0.
I also had to install a few modules: $ npm install autoprefixer
$ npm run dev // works now
I have NVM 0.30.1 and used it to install node.js v5.4.0 (with NPM 3.5.4) on Fedora 22. When I run npm update -g, I receive the following warnings:
npm WARN EBUNDLEOVERRIDE Replacing bundled npm > init-package-json with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled npm > node-gyp with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled npm > npm-install-checks with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled npm > npmlog with new installed version
npm WARN EBUNDLEOVERRIDE Replacing bundled npm > read-package-json with new installed version
And after that, when I run npm I get this error:
module.js:328
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at /home/peflorencio/.nvm/versions/node/v5.4.0/lib/node_modules/npm/bin/npm-cli.js:20:13
at Object.<anonymous> (/home/peflorencio/.nvm/versions/node/v5.4.0/lib/node_modules/npm/bin/npm-cli.js:76:3)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
Does anyone know what it is and how to solve it?
Thanks
What fixed this for me was
sudo rm -rf /usr/local/lib/node_modules/
and then re-installing node (with npm).
Thanks for the answers. It was a bug and it has already been fixed in Node v5.4.1. Now it's working as usual.
It looks like npm update -g cannot update npm to the newest version. I solve the problem by updating npm installation manually.
Install/ reinstall node to get the bundled npm
run npm install -g npm#3.5.4 to update the global npm installation
now npm update -g should work
I have faced the same issue in my Windows 10 PC. After looking into solutions, since i couldn't find the exact solution for the issue i was facing
Cannot find module 'npmlog'
I just uninstalled the node js and then, deleted both 'npm' and 'npm-cache' in
"C:\Users\YourPCName\AppData\Roaming"
Then, i downloaded the latest version of node from Node JS Website
And, installed node js
After that i checked with the path in environment variables.
Finally run the command prompt 'run as administrator' and npm install npm -g
Checking your version will show the latest version. 'npm -v'
I got the latest version - v3.10.9
Try this. this should work.
If people with linux are facing the problem, here is the solution:
As of the date of this post, the NPM version packaged with Nodejs doesn't work. If you installed this package, run
sudo rm -rf /usr/local/bin/npm
sudo apt-get install node
sudo mv /usr/bin/npm /usr/local/bin/npm
New version should be 3.10.8 and the old error gone
init-package-json, node-gyp, npm-install-checks, npmlog, read-package-json didn't installed correctly. Not sure why though.
Didn't find the root cause for the issue but I used the hacky way to install the packages above for now:
Roll back to the previous node version which npm didn't be updated. For example, nvm use iojs
cd to where npm installed, for example, cd /home/peflorencio/.nvm/versions/node/v5.4.0/lib/node_modules/npm and reinstall those packages like rm -rf node_modules/init-package-json && npm install init-package-json etc.
Some of the answers already answered the question, but I will still like to throw in my own idea. I encountered same issue after I was told to run npm update -g npm after running that piece of code, the error started. I solved mine by using Node Version Manager(nvm):
nvm install 8
Note: not actually 8, but to a version of your choice e.g(6,5). Writing the version number will automatically install the stable of the version specified.
After the installation you should get a CLI message:
Now using node v8.11.4 (npm v5.6.0)
If you're using a Mac, perform the following steps, to remedy (assuming you have Homebrew installed already):
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
(to overcome bash: /usr/local/bin/npm: No such file or directory error):
hash -r
Then go ahead with updating brew (to keep its kegs up to date) and the reinstallation process, linking is optional.
brew update
brew reinstall node
brew link --overwrite node
At any point inbetween you can use npm -v or node -v to test whether or not you are making progress. If you have node returning a version, but not npm then you will need to add your path to your environment with:
export PATH="/usr/local/bin:$PATH"
There is an option to bump npm without reinstalling node.
#### # this will remove current npm
rm -rf /usr/local/lib/node_modules/npm/
#### # install npm from sources. Version 3.5.x will be installed
apt-get update
apt-get install npm
#### # install the newest npm version. Bumping from 3.5.X to 6.14.X goes without any issue :)
/usr/bin/npm install npm#latest -g
#### # additionally, npm with version 3.5.x is not added to $PATH, so it's not used.
I have an app written using Mean.IO and deployed to Heroku (Buildpack https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt).
It's been fine up until my latest deploy this morning and has broken for no apparent reason. Bower seems to be running fine
2015-01-06T00:09:50.851963+00:00 app[web.1]: Error: ENOENT, no such file or directory '/app/bower_components/jquery/dist/jquery.min.map'
2015-01-06T00:09:50.851967+00:00 app[web.1]: at Object.fs.openSync (fs.js:439:18)
2015-01-06T00:09:50.851969+00:00 app[web.1]: at Object.fs.readFileSync (fs.js:290:15)
2015-01-06T00:09:50.851979+00:00 app[web.1]: at Promise.<anonymous> (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
2015-01-06T00:09:50.851984+00:00 app[web.1]: at Promise.fulfill (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
2015-01-06T00:09:50.851982+00:00 app[web.1]: at Promise.emit (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
2015-01-06T00:09:50.851985+00:00 app[web.1]: at Object.cb (/app/node_modules/mongoose/lib/query.js:1146:30)
2015-01-06T00:09:50.851981+00:00 app[web.1]: at Promise.emit (events.js:95:17)
2015-01-06T00:09:50.851976+00:00 app[web.1]: at Config.onPackageRead (/app/node_modules/meanio/lib/config.js:101:25)
2015-01-06T00:09:50.869507+00:00 app[web.1]: Worker 11 died :(
Relevant deploy code here
-----> Installing dependencies
npm WARN package.json karma-chrome-launcher#0.1.7 No README data
npm WARN package.json karma-coffee-preprocessor#0.2.1 No README data
npm WARN package.json karma-coverage#0.2.7 No README data
npm WARN package.json karma-phantomjs-launcher#0.1.4 No README data
> mean#0.4.2 postinstall /tmp/build_f7b66ed6667be26db9cf377edd6379ea
> node node_modules/meanio/node_modules/mean-cli/bin/mean-postinstall
Installing Bower dependencies
Auto installing package dependencies
Auto installing package dependencies
Installing module: mean-admin:
git clone --branch master https://git.mean.io/linnovate/mean-admin.git packages/contrib/mean-admin
Dependencies installed for package access
Dependencies installed for package articles
Dependencies installed for package system
Dependencies installed for package theme
Dependencies installed for package users
Dependencies installed for package dashboard
Dependencies installed for package linktexting
> mean-health#0.1.7 postinstall /tmp/build_f7b66ed6667be26db9cf377edd6379ea/packages/contrib/mean-admin/node_modules/mean-health
> node ./postinstall.js
Error: ENOENT, open '.bower-cache/fe2fe255e91d251051d543998aa8327a-1.11.2.lock'
gridfs-stream#0.5.3 node_modules/gridfs-stream
mean-health#0.1.7 node_modules/mean-health
request#2.51.0 node_modules/request
Dependencies installed for package mean-admin
-----> Caching node_modules directory for future builds
-----> Cleaning up node-gyp and npm artifacts
-----> Building runtime environment
-----> Exporting config vars to environment
grunt-cli#0.1.13 node_modules/grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.5)
└── findup-sync#0.1.3 (glob#3.2.11)
grunt#0.4.5 node_modules/grunt
-----> Found Gruntfile, running grunt heroku:development task
Running "cssmin:core" (cssmin) task
>> Destination not written because minified CSS was empty.
Running "uglify:core" (uglify) task
>> Destination bower_components/build/js/dist.min.js not written because src files were empty.
Done, without errors.
I see the line
Error: ENOENT, open '.bower-cache/fe2fe255e91d251051d543998aa8327a-1.11.2.lock'
But I'm not sure what that means heroku wise. Any ideas?
Try running bower update it will install the missing jQuery dependencies
From the documentation
http://learn.mean.io/#m-e-a-n-stack-more-information
**Update NPM, Bower or Grunt**
Sometimes you may find there is a weird error during install
like npm’s Error: ENOENT. Usually updating those tools to
the latest version solves the issue.
Updating NPM:
$ npm update -g npm
Updating Grunt:
$ npm update -g grunt-cli
Updating Bower:
$ npm update -g bower