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.

Error running npm run web:dev on windows

See original GitHub issue

Hi

When I try running your project web part on windows 10 machine I get the following error:

D:\DEV\react\rfx\node_modules\webpack-dev-middleware\middleware.js:106
                        if(err) throw err;
                                ^
 Error: invalid argument
    at pathToArray (D:\DEV\react\rfx\node_modules\memory-fs\lib\MemoryFileSystem.js:44:10)
    at MemoryFileSystem.mkdirpSync (D:\DEV\react\rfx\node_modules\memory-fs\lib\MemoryFileSystem.js:139:13)
    at MemoryFileSystem.(anonymous function) [as mkdirp] (D:\DEV\react\rfx\node_modules\memory-fs\lib\MemoryFileSystem.js:279:34)
    at Compiler.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\Compiler.js:229:25)
    at Compiler.applyPluginsAsync (D:\DEV\react\rfx\node_modules\tapable\lib\Tapable.js:60:69)
    at Compiler.emitAssets (D:\DEV\react\rfx\node_modules\webpack\lib\Compiler.js:226:7)
    at Watching.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\Compiler.js:54:18)
    at D:\DEV\react\rfx\node_modules\webpack\lib\Compiler.js:403:12
    at Compiler.next (D:\DEV\react\rfx\node_modules\tapable\lib\Tapable.js:67:11)
    at Compiler.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\CachePlugin.js:40:4)
    at Compiler.applyPluginsAsync (D:\DEV\react\rfx\node_modules\tapable\lib\Tapable.js:71:13)
    at Compiler.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\Compiler.js:400:9)
    at Compilation.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\Compilation.js:577:13)
    at Compilation.applyPluginsAsync (D:\DEV\react\rfx\node_modules\tapable\lib\Tapable.js:60:69)
    at Compilation.<anonymous> (D:\DEV\react\rfx\node_modules\webpack\lib\Compilation.js:572:10)
    at Compilation.applyPluginsAsync (D:\DEV\react\rfx\node_modules\tapable\lib\Tapable.js:60:69)
My npm-debug.log file is as follows:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'web:dev' ]
2 info using npm@3.9.3
3 info using node@v6.2.1
4 verbose run-script [ 'preweb:dev', 'web:dev', 'postweb:dev' ]
5 info lifecycle rfx-stack@0.5.0-alpha.5~preweb:dev: rfx-stack@0.5.0-alpha.5
6 silly lifecycle rfx-stack@0.5.0-alpha.5~preweb:dev: no script for preweb:dev, continuing
7 info lifecycle rfx-stack@0.5.0-alpha.5~web:dev: rfx-stack@0.5.0-alpha.5
8 verbose lifecycle rfx-stack@0.5.0-alpha.5~web:dev: unsafe-perm in lifecycle true
9 verbose lifecycle rfx-stack@0.5.0-alpha.5~web:dev: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\DEV\react\rfx\node_modules\.bin;C:\Program Files\nodejs;D:\Home\BAT\;d:\dev\tools\graphicsmagick;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Python2;C:\Users\dariu\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;c:\Program Files\MongoDB\Server\3.2\bin\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\cURL\bin;C:\Users\dariu\.dnx\bin;D:\DEV\Ruby\bin;C:\Users\dariu\AppData\Local\.meteor\;C:\Users\dariu\AppData\Local\atom\bin;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\dariu\AppData\Roaming\npm
10 verbose lifecycle rfx-stack@0.5.0-alpha.5~web:dev: CWD: D:\DEV\react\rfx
11 silly lifecycle rfx-stack@0.5.0-alpha.5~web:dev: Args: [ '/d /s /c',
11 silly lifecycle   'SET NODE_ENV=development & node ./run/start.web.js' ]
12 silly lifecycle rfx-stack@0.5.0-alpha.5~web:dev: Returned: code: 1  signal: null
13 info lifecycle rfx-stack@0.5.0-alpha.5~web:dev: Failed to exec web:dev script
14 verbose stack Error: rfx-stack@0.5.0-alpha.5 web:dev: `SET NODE_ENV=development & node ./run/start.web.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:245:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:852:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid rfx-stack@0.5.0-alpha.5
16 verbose cwd D:\DEV\react\rfx
17 error Windows_NT 10.0.10586
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "web:dev"
19 error node v6.2.1
20 error npm  v3.9.3
21 error code ELIFECYCLE
22 error rfx-stack@0.5.0-alpha.5 web:dev: `SET NODE_ENV=development & node ./run/start.web.js`
22 error Exit status 1
23 error Failed at the rfx-stack@0.5.0-alpha.5 web:dev script 'SET NODE_ENV=development & node ./run/start.web.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the rfx-stack package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     SET NODE_ENV=development & node ./run/start.web.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs rfx-stack
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls rfx-stack
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

api part starts fine. What might be a problem

Many thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rickmedcommented, Jul 20, 2016

so the problem was in webpack.config.babel in windows, match.script is not matching the npm script name, so I replaced the function with process.env.npm_lifecycle_event === “web:dev” and got passed the error, but then I got

C:\Users\rickm\Documents\Google Drive\Projects\NodeJS\rfx-stack\src\shared\app.js:34 var uri = [‘http://’, config.io.host, ‘:’, config.io.port].join(‘’); ^

TypeError: Cannot read property ‘io’ of undefined

and got tired of debugging 😃

EDIT: ookaayyy gave it another shot and there was indeed cross OS env shenanigans going on so I installed cross-env and change package.json to “web:dev”: “cross-env NODE_ENV=development node ./run/start.web.js”

and it worked (I’m on win 10), cheers

0reactions
foxhound87commented, Jul 20, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors when running npm run build on Windows #18437
Running npm run build results in numerous errors. ... Run the command prompt in Windows as admin. ... Errors begin to rack up,...
Read more >
npm start errors with ERR! code ENOENT, syscall open
Just cd to the app directory where package.json is and run npm start again.
Read more >
How to fix start script error when running npm start command
In this video we are going to learn how to fix start script error when running npm start command.Thank You For Visiting My...
Read more >
The term 'npm' is not recognized as the name of a cmdlet ...
Solution to fixing the 'npm' is not recognized error on your Windows 10 development machine.
Read more >
Error: cannot find module [Node npm Error Solved]
you're trying to import an item from a module you don't have installed in your project directory · you're importing some things from...
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