Cannot package a node app
I am getting this error when I am running pkg index.js
TypeError: Expected cwd to be of type string but received type undefined
at module.exports.sync (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\dir-glob\index.js:56:9)
at globDirs (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:58:9)
at getPattern (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:61:64)
at globTasks.reduce (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:107:19)
at Array.reduce (
I have the same error. OS: Ubuntu 18.04 Node.js 11, latest pkg version. I also tried v. 4.3.0
Error! TypeError: Expected
cwdto be of typestringbut received typeundefinedat module.exports.sync (/home/userr/.local/lib/node_modules/pkg/node_modules/dir-glob/index.js:56:9) at globDirs (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:58:9) at getPattern (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:61:64) at globTasks.reduce (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:107:19) at Array.reduce () at Function.module.exports.sync (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:106:26) at collect (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:145:27) at expandFiles (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:152:9) at Walker._callee$ (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:215:27) at tryCatch (/home/userr/.local/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:62:40)
Also same issue with OS: Raspbian GNU/Linux 9 (stretch).
Error! TypeError: Expected
cwdto be of typestringbut received typeundefinedat module.exports.sync (/usr/lib/node_modules/pkg/node_modules/dir-glob/index.js:56:9) at globDirs (/usr/lib/node_modules/pkg/node_modules/globby/index.js:58:9) at getPattern (/usr/lib/node_modules/pkg/node_modules/globby/index.js:61:64) at globTasks.reduce (/usr/lib/node_modules/pkg/node_modules/globby/index.js:107:19) at Array.reduce () at Function.module.exports.sync (/usr/lib/node_modules/pkg/node_modules/globby/index.js:106:26) at collect (/usr/lib/node_modules/pkg/lib-es5/walker.js:145:27) at expandFiles (/usr/lib/node_modules/pkg/lib-es5/walker.js:152:9) at Walker._callee$ (/usr/lib/node_modules/pkg/lib-es5/walker.js:375:25) at tryCatch (/usr/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:62:40)`
Attempted to downgrade with
npm install -g [email protected]
but was unable to downgrade.
#603
Same on mac os.
npm install -g https://github.com/randallknutson/pkg.git#build
and a reboot worked for me
Fixed in [email protected]. Thanks!