Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

npm install/npm start failing. #1340

Closed
roborracle opened this issue Jan 7, 2019 · 17 comments
Closed

npm install/npm start failing. #1340

roborracle opened this issue Jan 7, 2019 · 17 comments
Labels
build error Error with the build process

Comments

@roborracle
Copy link

I've got an older project that I need to update but npm install > npm start is failing.

to be clear - I've already removed the node_modules directory and tried to re-run.

I also tried updating the package.json file to the most recent version so all packages are up to date, but it continues to fail.

I just updated to the latest stable version of node.js 11.6.0 and the previous version where I first found this error was from around version ~10.8

Here is the output from npm install which seems remarkably thin judging based on previous instances of use:

> [email protected] install /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/fsevents
> node install

node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v67-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI, unknown) (falling back to source compile with node-gyp) 
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
../fsevents.cc:63:6: warning: field 'async_resource' will be initialized after field 'lockStarted' [-Wreorder]
   : async_resource("fsevents:FSEvents"), lockStarted(false) {
     ^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
  COPY /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

> [email protected] install /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/SMG_Rob/.npm/node-sass/4.11.0/darwin-x64-67_binding.node

> [email protected] postinstall /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/node-sass
> node scripts/build.js

Binary found at /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/node-sass/vendor/darwin-x64-67/binding.node
Testing binary
Binary is fine

> [email protected] postinstall /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/gifsicle
> node lib/install.js

  ✔ gifsicle pre-build test passed successfully

> [email protected] postinstall /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/jpegtran-bin
> node lib/install.js

  ✔ jpegtran pre-build test passed successfully

> [email protected] postinstall /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/node_modules/optipng-bin
> node lib/install.js

  ✔ optipng pre-build test passed successfully
added 1271 packages from 987 contributors and audited 25417 packages in 35.791s
found 0 vulnerabilities

Here is the error output:


> [email protected] start /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme
> gulp

internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module 'run-sequence'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/gulpfile.js:9:19)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Not sure what I need to do here to get sass running compiling again and would love any help I could get.

@dgobnto
Copy link
Contributor

dgobnto commented Jan 8, 2019

From the readme file:

This project requires Node.js v4.x.x to v6.11.x to be installed on your machine. Please be aware that you might encounter problems with the installation if you are using the most current Node version (bleeding edge) with all the latest features.

You might wanna downgrade to nodejs v6.11.5 (with nvm) or try the fix mentioned here, here and here.

@GuillaumeComadequat
Copy link

i have a similar issue with node v10.15.0

@roborracle
Copy link
Author

@dgobnto - thanks for the response here. I didn't realize it wouldn't perform correctly on newer versions of Node.js, so I tried rolling back to 6.11.1. No luck.

I checked the package.json for the links you mentioned, no luck there either.

npm install still fails, as does npm start

> [email protected] start /Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme
> gulp

module.js:471
    throw err;
    ^

Error: Cannot find module 'run-sequence'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Applications/MAMP/htdocs/my-project/wp-content/themes/my-theme/gulpfile.js:9:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm ERR! Darwin 17.7.0
npm ERR! argv "/Users/SMG_Rob/.nvm/versions/node/v6.11.1/bin/node" "/Users/SMG_Rob/.nvm/versions/node/v6.11.1/bin/npm" "start"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the foundationpress package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs foundationpress
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls foundationpress
npm ERR! There is likely additional logging output above.

Looks like the same error output as before.

FWIW - this is an older project - probably around ~2 years old. I tried exchanging the old package.json with the newest version so that all the node_modules would be pulling in the latest.

@dgobnto
Copy link
Contributor

dgobnto commented Jan 9, 2019

Which version of Foundation do you have in the node_modules folder? Look for the package.json file in node_modules > foundation-sites.
Did you clean cache and delete node_modules folder before npm install?
In the meanwhile, make a fresh install to see if you run into the same problems.

@dgobnto
Copy link
Contributor

dgobnto commented Jan 9, 2019

I believe it's your gulpfile that is outdated (you should have a gulpfile.babel.js file rather than gulpfile.js).
If you need to update Foundation / FoundationPress maybe it would be easier to make a fresh install and import your old site into the new installation. If you don't need to update, just stick to your old release of FoundationPress and pay attention to the required nodejs version (you can navigate the file tree for your FoundationPress release and check for nodejs requirements in the readme file).

@GuillaumeComadequat
Copy link

in the readme.md :
"This project requires Node.js v4.x.x to v6.11.x to be installed on your machine. Please be aware that you might encounter problems with the installation if you are using the most current Node version (bleeding edge) with all the latest features."

grrrrr it is never simple !
So i am going to try to downgrade nodejs. thank you !

@roborracle
Copy link
Author

Which version of Foundation do you have in the node_modules folder? Look for the package.json file in node_modules > foundation-sites.
Did you clean cache and delete node_modules folder before npm install?
In the meanwhile, make a fresh install to see if you run into the same problems.

node_modules/foundation-sites/package.json = "[email protected]",

I did delete node_modules (a couple times) before.

Not sure what cache you're referring to?

@dgobnto
Copy link
Contributor

dgobnto commented Jan 9, 2019

@roborracle I meant npm cache, with npm cache clean --force, but I don't think it will help anyway.

@roborracle
Copy link
Author

I believe it's your gulpfile that is outdated (you should have a gulpfile.babel.js file rather than gulpfile.js).
If you need to update Foundation / FoundationPress maybe it would be easier to make a fresh install and import your old site into the new installation. If you don't need to update, just stick to your old release of FoundationPress and pay attention to the required nodejs version (you can navigate the file tree for your FoundationPress release and check for nodejs requirements in the readme file).

yea, I can't get it working. How would you recommend upgrading to the latest version of FP? Seems that would be preferrable at this point, but I don't know of an easy way to separate out my theme from what a new instance of FP would install and/or how to integrate it. If you have advice there, I'd be most grateful.

@dgobnto
Copy link
Contributor

dgobnto commented Jan 9, 2019

@roborracle It depends on the FoundationPress release you started the project with, how much modification you have done and whether you're using git. It could be a more or less easy task or it could be a very tedious one.
I think it's always better to keep things steady while working on a project, hence my previous suggestion of sticking with your current FoundationPress release.
But if you really need to update, I believe you could try a fresh install of FoundationPress in a new folder and replace the src folder, templates and php files, etc with your current ones (this is a very clumsy and cumbersome way but, depending on the state of your project, it should work).
If you're using git, you might wanna commit your project, add a new branch, install latest FoundationPress, merge things and go through conflicts.

#1120 and this might be useful.

Have you replaced your gulpfile with the latest one in the meanwhile?

@FlatspinZA
Copy link

FlatspinZA commented Jan 9, 2019

gulp-cli needs to be installed globally, from what I can see regarding your error.

I was having that same problem and found the recommendation to install gulp-cli globally on another thread regarding other software. Spent many hours tearing my hair out.

Fixed my problems with npm install/start

@derweili derweili added the build error Error with the build process label Jan 14, 2019
@derweili
Copy link
Collaborator

I think the problem is a a new, updated version of the package.json with updated versions of the dependencies on the one hand and an old version of the build process (gulpfile).

Because the build-process (gulpfile.js / gulpfile.babel.js) make use of the dependencies defined in the package.json both files must be compatible.

So I think there are two ways to solve this:

  1. Switch back the the original package.json
    If to do this, you may have to use an older node version (6.11)

  2. Switch to the latest package.json and gulpfile.babel.json
    If you do this, there could be additional problems depending on else has changed since your original version.

Personally I would prefere the first option.

@derweili
Copy link
Collaborator

gulp-cli needs to be installed globally, from what I can see regarding your error.

No, gulp-clidoes not have to be installed globally.

@derweili
Copy link
Collaborator

@GuillaumeComadequat

"This project requires Node.js v4.x.x to v6.11.x to be installed on your machine. Please be aware that you might encounter problems with the installation if you are using the most current Node version (bleeding edge) with all the latest features."

The latest version is compatible with node v10 and node v11

I just testet those versions and had not problem.

Older versions of FoundationPress had issues with node versions newer than 6.11.xx
Because @roborracle uses an older version of FoundationPress he has those problems.

@roborracle
Copy link
Author

So to give an update here - basically, I had to clean up my old version and use nvm to switch back to 6.11.5. That combined with the the correct command to watch and compile - note in the older versions the command was npm run watch not npm start. Once I got those lined up with the cleaned up package.json I was able to get it all running again properly.

@derweili
Copy link
Collaborator

derweili commented Jan 18, 2019

@roborracle

Back in August 2017 there was a breaking change in FoundationPress.

Webpack replaced the previous JavaScript Build Process, the assets management changed (separate src and dist folders).

This was the time when the name of the script was changed. Not sure why it was changed.

Because of this reasons it is not possible to use the new build process with the old structure. (without major changes to you project) This old build process does not support newer versions of node.

I think this issues is solved. If you have further questions, feel free to re-open the issue.

@FlatspinZA
Copy link

gulp-cli needs to be installed globally, from what I can see regarding your error.

No, gulp-clidoes not have to be installed globally.

Strange, because I have never had the problem with npm install/start & the only solution I could find was to install gulp-cli globally from another git repository where they were having issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build error Error with the build process
Projects
None yet
Development

No branches or pull requests

5 participants