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

npm start not working, tried many solves :| #1328

Closed
luukee opened this issue Oct 31, 2018 · 6 comments
Closed

npm start not working, tried many solves :| #1328

luukee opened this issue Oct 31, 2018 · 6 comments
Labels
build error Error with the build process

Comments

@luukee
Copy link

luukee commented Oct 31, 2018

How can this bug be reproduced?

  1. renamed the foundationpress theme folder
  2. ran into multiple issues.
  3. copy and pasted package.json and package-lock.json from this repo to my theme's, respective, files as a fix.
  4. Deleted the node_modules folder
  5. run npm install on the theme folder

What did you expect to happen?
I expected npm to install so I could boot up and run the site in the localhost:8888 window

What happened instead?
Atom (the editor) freezes, as well as terminal and I get this error in terminal:

Unhandled rejection Error: Command failed: /usr/local/bin/git checkout 4.0
error: pathspec '4.0' did not match any file(s) known to git

    at ChildProcess.exithandler (child_process.js:289:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

⸨            ░░░░░░⸩ ⠦ extract:fsevents: sill extract is-accessor-descriptor@1.

Please List the Following:

  • OS & version: Mojave 10.14
  • Node version (node -v) [Node v4+ is required] : v10.11.0
  • FoundationPress version (see line 3 in package.json): 2.10.4
  • Foundation version (found in node_modules/foundation-sites/package.json) : no file named foundation-sites??

Please help, this is driving me wild. Haha.

Thanks!
Luke

@luukee luukee changed the title npm run not working, tried many solves :| npm start not working, tried many solves :| Oct 31, 2018
@DeiCha
Copy link

DeiCha commented Nov 7, 2018

Just read fixes: #1312 #1316 ( probably problem is releated with gulp package)

Sadly can't help with atom (using sublime) but it could happen if you don't exclude node_modules folder when importing project.

@luukee
Copy link
Author

luukee commented Nov 21, 2018

@DeiCha Thank you!

Your reply here fixed it for me.

Also, I'm using nvm to downgrade to node version 6.11.5.

After installing nvm I ran this to check which version I was on:

node -v

Then I ran

nvm use 6

. . . then I started at your second bullet point:

  • npm rm -rf node_modules (to delete packages if some of them installed)
  • delete: package-lock.json
  • try npm init and npm install again

Everything works!

**although I still have these "deprecated" warnings:

npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN prefer global [email protected] should be installed with -g

And on npm start I see this failed to load:

[09:40:24] Failed to load external module @babel/register

But it FINALLY works!

Thanks again @DeiCha!

@FlatspinZA
Copy link

Try running npm audit fix, which will still leave you with some warnings which can be fixed with npm audit fix --force

There is one last issue that needs to be manually fixed. --force won't fix it, but if you run npm audit fix again, it will allow you to scroll & update the package manually.

Nothing broke for me as far as I can tell.

@luukee
Copy link
Author

luukee commented Nov 27, 2018

Thanks! I’ll give it a try.

@luukee
Copy link
Author

luukee commented Dec 6, 2018

@FlatspinZA

Try running npm audit fix, which will still leave you with some warnings which can be fixed with npm audit fix --force

On running npm audit fix I received this error:
npm ERR! Invalid Version: github:gulpjs/gulp#71c094a51c7972d26f557899ddecab0210ef3776
. . . should I risk the npm audit fix --force? I ask because I'm pretty far into the theme build and I don't want to lose all of my work, or mess something up (I'm a newbie with command line stuff :).

Admittedly, primary reasons being: I just now pushed the theme to GitHub. I should've done it a long time ago :|

I also wanted to show you some of the peculiar SASS warnings I get when I run npm start:

Luke-MacBook-Prolocal:comedy-dynamics lukecarlhartman$ npm start

> [email protected] start /Users/lukecarlhartman/Sites/comedydynamics/wp-content/themes/comedy-dynamics
> gulp

[19:55:19] Failed to load external module @babel/register
[19:55:19] Requiring external module babel-register
[19:55:21] Loading config file...
[19:55:21] config.yml exists, loading config.yml
[19:55:21] Using gulpfile ~/Sites/comedydynamics/wp-content/themes/comedy-dynamics/gulpfile.babel.js
[19:55:21] Starting 'default'...
[19:55:21] Starting 'build'...
[19:55:21] Starting 'clean'...
[19:55:21] Finished 'clean' after 32 ms
[19:55:21] Starting 'sass'...
[19:55:21] Starting 'webpack:build'...
[19:55:21] Starting 'images'...
[19:55:21] Starting 'copy'...
[19:55:22] Finished 'copy' after 969 ms
DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("shake")) instead.

DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("shake")) instead.

DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("spin")) instead.

DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("spin")) instead.

DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("wiggle")) instead.

DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal
in Sass 4.0. Use call(get-function("wiggle")) instead.

WARNING: flex-grid-row-align(): flex-start is not a valid value for horizontal alignment. Use left, right, center, justify, or spaced.
         on line 38 of node_modules/foundation-sites/scss/util/_flex.scss, in mixin `flex-align`
         from line 16 of src/assets/scss/components/_featured-image.scss, in mixin `@content`
         from line 165 of node_modules/foundation-sites/scss/util/_breakpoint.scss, in mixin `breakpoint`
         from line 5 of src/assets/scss/components/_featured-image.scss
         from line 78 of src/assets/scss/app.scss

WARNING: flex-grid-row-align(): center is not a valid value for vertical alignment. Use top, bottom, middle, or stretch.
         on line 47 of node_modules/foundation-sites/scss/util/_flex.scss, in mixin `flex-align`
         from line 41 of src/assets/scss/components/_featured-image.scss
         from line 78 of src/assets/scss/app.scss

WARNING: flex-grid-row-align(): center is not a valid value for vertical alignment. Use top, bottom, middle, or stretch.
         on line 47 of node_modules/foundation-sites/scss/util/_flex.scss, in mixin `flex-align`
         from line 45 of src/assets/scss/components/_featured-image.scss
         from line 78 of src/assets/scss/app.scss

WARNING: flex-grid-row-align(): center is not a valid value for vertical alignment. Use top, bottom, middle, or stretch.
         on line 47 of node_modules/foundation-sites/scss/util/_flex.scss, in mixin `flex-align`
         from line 11 of src/assets/scss/components/_accordion.scss
         from line 81 of src/assets/scss/app.scss

Any of your suggestions are greatly appreciated 👍

Thanks so much for your help!
-Luke

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

This was an error with the gulp dependency. It is already fixed

To solve this problem in your project follow these steps:

  1. Delete the node_modules folder.
  2. Open the package.json
  3. Search for "gulp": "gulpjs/gulp#4.0", and replace it with "gulp": "^4.0",
  4. Make sure you have node version 6.11.xx installed
  5. Run npm install

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

4 participants