question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] npm run develop does not work on Windows machine

See original GitHub issue

Another user (@cmccormack and I who both uses Windows, have run into a problem with the latest master updates when it comes to trying to running npm run develop on our local machines.

See the following when I tried running npm run develop in git-bash:

$ npm run develop

> @freecodecamp/freecodecamp@0.0.1 develop D:\coding\fcc
> npm-run-all -s ensure-env start-develop


> @freecodecamp/freecodecamp@0.0.1 ensure-env D:\coding\fcc
> cross-env DEBUG=fcc:* node ./tools/scripts/ensure-env.js

  fcc:tools:ensure-env ignoring creation of redirect file in undefined +0ms
  fcc:tools:ensure-env pathMigration present +11ms

> @freecodecamp/freecodecamp@0.0.1 start-develop D:\coding\fcc
> node ./tools/scripts/start-develop.js


> @freecodecamp/client@1.0.0 predevelop D:\Coding\fcc\client
> npm run prebuild

Debugger listening on ws://127.0.0.1:9229/ce7034de-7844-41f5-ab4a-bccf273b8f06
For help see https://nodejs.org/en/docs/inspector

> @freecodecamp/client@1.0.0 prebuild D:\Coding\fcc\client
> npm run build:frame-runner && node ../tools/scripts/ensure-env.js


> @freecodecamp/client@1.0.0 build:frame-runner D:\Coding\fcc\client
> webpack --env.production --config ./webpack-frame-runner.js

  fcc:server:datasources using MailHog server on port 1025 +0ms
  fcc:server:utils:about no google applications credentials environmental variable found
  fcc:server:utils:about 'GOOGLE_APPLICATION_CREDENTIALS'
  fcc:server:utils:about 'activeUser' api will always return 0
  fcc:server:utils:about this can safely be ignored during development +3s
  fcc:models:user setting up user hooks +934ms
  fcc:server freeCodeCamp server listening on port 3000 in development +4s
  fcc:server connecting to db at mongodb://localhost:27017/freecodecamp +26ms
Hash: d0144a0e981d544fd117
Version: webpack 4.22.0
Time: 10622ms
Built at: 2018-12-10 19:14:18
                Asset      Size  Chunks             Chunk Names
      frame-runner.js   235 KiB       0  [emitted]  frame-runner
  frame-runner.js.map  1.18 MiB       0  [emitted]  frame-runner
      sass-compile.js  1.13 KiB       1  [emitted]  sass-compile
  sass-compile.js.map  4.89 KiB       1  [emitted]  sass-compile
    test-evaluator.js   156 KiB       2  [emitted]  test-evaluator
test-evaluator.js.map   811 KiB       2  [emitted]  test-evaluator
Entrypoint frame-runner = frame-runner.js frame-runner.js.map
Entrypoint sass-compile = sass-compile.js sass-compile.js.map
Entrypoint test-evaluator = test-evaluator.js test-evaluator.js.map
 [92] (webpack)/buildin/global.js 489 bytes {0} {2} [built]
      ModuleConcatenation bailout: Module is not an ECMAScript module
[320] ./src/client/frame-runner.js 4.13 KiB {0} [built]
      ModuleConcatenation bailout: Module uses eval()
[321] ./src/client/workers/sass-compile.js 253 bytes {1} [built]
      ModuleConcatenation bailout: Module is not an ECMAScript module
[322] ./src/client/workers/test-evaluator.js 2.49 KiB {2} [built]
      ModuleConcatenation bailout: Module uses eval()
    + 324 hidden modules

> @freecodecamp/client@1.0.0 develop D:\Coding\fcc\client
> gatsby develop

  fcc:server db connected +1s

  fcc:boot:donate activeDonator count: 0 +1s
No Stripe API keys were found, moving on...

It hung on that last part. Both @cmccormack and I waited a very long time to no avail.

I even deleted my local repo and re-cloned and still was not able to make it work.

The only way to get it to work is a two create two session windows. In the first session you need to switch to api-server/ and then run node development-entry.js. Once it gets to the same part regarding the “No Stripe API keys were found, moving on…”, in the second session, you then run npm run develop and it will finally work and you will see:

You can now view @freecodecamp/client in the browser.

  http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site's data and schema

  http://localhost:8000/___graphql

Note that the development build is not optimized.
To create a production build, use gatsby build

i 「wdm」:
i 「wdm」: Compiled successfully.

@Bouncey This is the same issue you helped @cmccormack work through back on November 27th.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
Bounceycommented, Jan 9, 2019

@RandellDawson

replace your scripts block with this

"scripts": {
    "postinstall": "npm run bootstrap",
    "prebootstrap": "npm run ensure-env",
    "bootstrap": "lerna bootstrap",
    "clean": "lerna clean",
    "develop": "npm-run-all -s ensure-env && npm-run-all -p start-develop-server start-develop-client",
    "ensure-env": "cross-env DEBUG=fcc:* node ./tools/scripts/ensure-env.js",
    "lint": "echo 'Warning: TODO - Define Linting with fixing.'",
    "seed": "npm-run-all -p seed:*",
    "seed:challenges": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedChallenges",
    "seed:news": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedNewsArticles",
    "start-develop-client": "cd ./client && node ./node_modules/gatsby-cli develop",
    "start-develop-server": "cd ./api-server && node development-entry.js",
    "pretest": "npm-run-all -s test:lint",
    "test": "npm-run-all -p test:*",
    "test:lint": "echo 'Warning: TODO - Define Linting tests.'",
    "test:client": "cd ./client && npm test && cd ../",
    "test:curriculum": "cd ./curriculum && npm test && cd ../",
    "test:challenge-formatting": "node ./tools/scripts/ci/ensure-challenge-formatting.js",
    "test:guide-formatting": "node ./tools/scripts/ci/ensure-guide-formatting.js",
    "test:server": "cd ./api-server && npm test && cd ../",
    "test:tools": "jest ./tools"
  },

Then try npm run develop again.

1reaction
Dana94commented, Jan 26, 2019

@RandellDawson

replace your scripts block with this

"scripts": {
    "postinstall": "npm run bootstrap",
    "prebootstrap": "npm run ensure-env",
    "bootstrap": "lerna bootstrap",
    "clean": "lerna clean",
    "develop": "npm-run-all -s ensure-env && npm-run-all -p start-develop-server start-develop-client",
    "ensure-env": "cross-env DEBUG=fcc:* node ./tools/scripts/ensure-env.js",
    "lint": "echo 'Warning: TODO - Define Linting with fixing.'",
    "seed": "npm-run-all -p seed:*",
    "seed:challenges": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedChallenges",
    "seed:news": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedNewsArticles",
    "start-develop-client": "cd ./client && node ./node_modules/gatsby-cli develop",
    "start-develop-server": "cd ./api-server && node development-entry.js",
    "pretest": "npm-run-all -s test:lint",
    "test": "npm-run-all -p test:*",
    "test:lint": "echo 'Warning: TODO - Define Linting tests.'",
    "test:client": "cd ./client && npm test && cd ../",
    "test:curriculum": "cd ./curriculum && npm test && cd ../",
    "test:challenge-formatting": "node ./tools/scripts/ci/ensure-challenge-formatting.js",
    "test:guide-formatting": "node ./tools/scripts/ci/ensure-guide-formatting.js",
    "test:server": "cd ./api-server && npm test && cd ../",
    "test:tools": "jest ./tools"
  },

Then try npm run develop again.

This script block change fixed my problem running it locally. I look forward to having it merged into master. Thanks @Bouncey I did not have any issues killing the process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"npm run dev" not working on Windows - Stack Overflow
"npm run dev" not working on Windows · 1. try node with --use_strict flag · 1. or install latest Node 6. · @priyesh-kumar...
Read more >
node-windows - npm
Start using node-windows in your project by running `npm i ... This is not a tool for developing applications, it is a tool...
Read more >
"npm run build:langfiles" does not work - Google Groups
I work on WIndows 10x64, with node15.6.0 and npm 7.4.0. I downloaded a fresh source code from github, and it's the same pb....
Read more >
Manage npm packages - Visual Studio (Windows)
Visual Studio helps you to manage packages using the Node.js package manager (npm)
Read more >
npm run is not recognized as an internal or external command
Problem – After running “npm start” execution got Then, I run command "npm test", the error has occur. g. UATHelper: Installing Sdk (Windows):...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found