jspm / npm

NPM Location Service
19 stars 34 forks source link

warn Error on build when running "jspm install" #177

Open ionutss opened 4 years ago

ionutss commented 4 years ago

With node v10 and npm v6, running the command "jspm install" will throw errors similar to the one below:

warn Error on build TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:159:9) at Object.fs.writeFile (fs.js:1278:14) at C:\Workspace\\node_modules\jspm-npm\lib\node-conversion.js:296:19

As you can see in the stacktrace, the problem is in "jspm-npm\lib\node-conversion.js:296:19"

A short fix will be to change the line like this: return fs.writeFile(dirFile, "module.exports = require('./" + dirName + "/index');\n", new Function()); Adding, a callback parameter to fs.writeFile() function.