node icon indicating copy to clipboard operation
node copied to clipboard

io.js 2.2.x 2.3.x nodemon on Windows

Open skcc75 opened this issue 11 years ago • 22 comments

C:\Users\Dev>nodemon
exception in nodemon killing node
Error: Cannot find module 'wrappy'
    at Function.Module._resolveFilename (module.js:332:15)
    at Function.Module._load (module.js:282:25)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\Sergiy Kyrylkov\AppData\Roaming\npm\node_modules\nodemon\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\once.js:1:76)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)

skcc75 avatar May 31 '15 09:05 skcc75

Is it possible that the wrappy module is not there because of too long filenames ?

targos avatar May 31 '15 09:05 targos

I am trying to reproduce but I cannot use npm with v2.2.0 because of a strange SSL error

targos avatar May 31 '15 10:05 targos

@targos it worked fine before the upgrade. the project was on io.js since the beginning.

skcc75 avatar May 31 '15 11:05 skcc75

Probably caused by https://github.com/nodejs/io.js/issues/1850

silverwind avatar May 31 '15 20:05 silverwind

@kyrylkov please retry with 2.2.1

silverwind avatar Jun 01 '15 05:06 silverwind

It is not fixed in 2.2.1, I am getting the same error

targos avatar Jun 01 '15 06:06 targos

@silverwind 2.2.1 doesn't solve the problem

skcc75 avatar Jun 01 '15 06:06 skcc75

@kyrylkov can you npm install nodemon -g again just to be sure that something that needs a rebuild gets rebuilt?

rvagg avatar Jun 01 '15 07:06 rvagg

@kyrylkov was this actually working on a previous version? You're running really close to the path limit on that one and I wouldn't be surprised if that's involved, already the error is being caused at once.js which has a 230 char path and if wrappy is supposed to be a dependency then you'd likely be pushing the limit

rvagg avatar Jun 01 '15 07:06 rvagg

@rvagg npm uninstall nodemon -g and npm install nodemon -g didn't help

skcc75 avatar Jun 01 '15 07:06 skcc75

@rvagg it worked all the way from io.js 1.0 or so. do you suggest to move the project folder closer to the root to try?

skcc75 avatar Jun 01 '15 07:06 skcc75

yeah, I'm wondering if something in npm has changed or perhaps a new version of nodemon or one of its dependencies has changed to alter the dependency tree to make it too deep; perhaps go to c:\ then npm install nodemon and then call it from where you need it as c:\node_modules\.bin\nodemon and see if you get different results

rvagg avatar Jun 01 '15 07:06 rvagg

@rvagg If you referring to C:\Users\Dev\AppData\Roaming\npm\node_modules\nodemon\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\once.js, this is not something that a user can change, since on Windows this is a default installation path for global node modules.

skcc75 avatar Jun 01 '15 07:06 skcc75

@rvagg local installation from a very shallow path (C:\a\node_modules\.bin\nodemon) works

skcc75 avatar Jun 01 '15 07:06 skcc75

@rvagg however this doesn't solve a problem of a default io.js Windows installation, since the path for global node modules remains very long with no easy way to change it.

skcc75 avatar Jun 01 '15 07:06 skcc75

@kyrylkov this is going to have to be something to take up with the npm team over at https://github.com/npm/npm, we just bundle the tool here and it controls the installation of packages.

you should be able to npm config set prefix=c:\a\ to change the default though, I'm not sure how Windows will handle the executables though, you may need to add c:\a\bin or something to your PATH.

rvagg avatar Jun 01 '15 08:06 rvagg

@rvagg got it. i'll open an issue at npm.

skcc75 avatar Jun 01 '15 08:06 skcc75

https://github.com/npm/npm/issues/8419

skcc75 avatar Jun 01 '15 08:06 skcc75

Are you sure that this is problem with NPM? iojs 2.2.0 can't find modules in long paths that are already installed. When I replace exe with iojs 2.1.0 (keeping latest npm), even "npm install" works correctly. iojs 2.2.0 and later breaks this (modules in long paths are not found). Returning to 2.1.0 fixes everything.

neVERberleRfellerER avatar Jun 16 '15 18:06 neVERberleRfellerER

@neVERberleRfellerER you are right, it is an issue introduced in 2.2.0. See https://github.com/nodejs/io.js/issues/1990 and https://github.com/nodejs/io.js/pull/1991.

targos avatar Jun 16 '15 18:06 targos