Trying to install PureScript and pulp on Windows 7 via node.js 5.3.0:
npm install -g purescript
npm install -g pulp
cd some-empty-dir
pulp init
The installations seemed to work correctly, but pulp
always fails with the error:
module.js:328
throw err;
^
Error: Cannot find module './pulp'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\pulp\index.js:2:1)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
index.js just contains these two lines:
#!/usr/bin/env node
require("./pulp");
C:\Users\me\AppData\Roaming\npm
is the last part of my PATH.
where pulp
returns
C:\Users\me\AppData\Roaming\npm\pulp
C:\Users\me\AppData\Roaming\npm\pulp.cmd
I tried the same with Git Bash but with the same results. I tried reinstalling purescript and pulp and node/npm but it did not change anything.
On another computer I had no problems. Something seems to interfere with my installation on this specific system. Environment variables, existing or non-existing directories, ...?
I'm not familiar with node.js and do not know where to look. Any idea what's wrong?
Edit: contents of files in path
C:\Users\me\AppData\Roaming\npm\pulp:
#!/bin/sh
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/node_modules/pulp/index.js" "$@"
ret=$?
else
node "$basedir/node_modules/pulp/index.js" "$@"
ret=$?
fi
exit $ret
C:\Users\me\AppData\Roaming\npm\pulp.cmd:
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\node_modules\pulp\index.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\node_modules\pulp\index.js" %*
)
Just running the command pulp
executes the "else" branch of pulp.cmd
.
Okay, turns out that I was missing bower
and/or jshint
. Everybody else probably had these packages already installed since they are so common.
I fixed the problem roughly by:
npm uninstall -g pulp
npm install -g bower
npm install -g jshint
npm install -g pulp
My best guess is that some postinstall script failed. Unfortunately, I cannot reproduce the problem anymore. Even after deinstalling node.js, deleting the folders in %HOME%\AppData\Roaming
and reinstalling everything from scratch: pulp
just works now.