Saleor: Installing Saleor on Mac OS X Sierra 10.12.6 - TypeError: "file" argument must be a non-empty string

Created on 17 Nov 2017  Â·  13Comments  Â·  Source: mirumee/saleor

So I'm following the standard script in installing the vanilla Saleor build and keep running into a nagging problem right at the very end. Story below:

What I'm trying to achieve

Install and run the base saleor e-commerce app.
I have installed all pre-requisites (as far as I can tell)

Steps to reproduce the problem

After meticulously following instructions, in both
(1) A virtualenv AND
(2) directly in the file system, I get to this step:
npm run build-assets

What I expected to happen

A build ready to run with "python manage.py runserver"

What happened instead/how it failed

Repeatedly got the following error on running the command:
npm run build-assets:

TypeError: "file" argument must be a non-empty string
at normalizeSpawnArguments (child_process.js:383:11)
at exports.spawn (child_process.js:496:38)
at Object.exports.execFile (child_process.js:212:15)
at Object.execFile (/Users/jakamoko/dev/saleor/node_modules/pn/_promisify.js:35:27)
at module.exports (/Users/jakamoko/dev/saleor/node_modules/svg2png/lib/svg2png.js:11:29)
at Object.nearest (/Users/jakamoko/dev/saleor/node_modules/favicons/helpers-es5.js:302:25)
at /Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:61:37
at fn (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:746:34)
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:1213:16
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:166:37
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:706:43
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:167:37
at Object.async.waterfall (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:710:44)
at createFavicon (/Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:60:23)
at /Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:108:24
at Object.async.forEachOf.async.eachOf (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:233:13)
at createFavicons (/Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:107:19)
at /Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:118:24
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:718:13
at async.forEachOf.async.eachOf (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:233:13)
at _parallel (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:717:9)
at Object.async.parallel (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:731:9)
at createPlatform (/Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:117:19)
at /Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:135:21
at Object.async.forEachOf.async.eachOf (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:233:13)
at createOffline (/Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:131:19)
at create (/Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:178:90)
at /Users/jakamoko/dev/saleor/node_modules/favicons/es5.js:184:20
at fn (/Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:746:34)
at /Users/jakamoko/dev/saleor/node_modules/async/lib/async.js:1213:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-assets: node ./node_modules/webpack/bin/webpack.js -p
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-assets script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jakamoko/.npm/_logs/2017-11-17T19_43_21_015Z-debug.log

Most helpful comment

hi guys,
It works now. I think the reason is that it failed to download some node's package, but it didn't show any error log.
I deleted node_modules folder and installed package again, it works.
thx

All 13 comments

Hello!
Could you tell us which version of NPM and Node you use? We are unable to reproduce this error locally.
Also, please make sure that all dependencies are installed without any error and you work with newest Saleor version. If everything seems to be okay and this error still occurs, please post log - you can find path at the end of console output.

Hi Dominik.

Thanks for reaching out. So at first I had the “latest” Node.js 8.9.1 (npm 5.5.1)

I then downgraded to Node.js 8.2.1 (npm 5.3.0) which didn’t work.

Then, for some strange reason, it finally worked when I used Python 2.7 (was using 3.6 before)

There was probably something else I did differently but I now have a working version.

Many thanks!

That's strange, npm commands should be independent of the Python environment. Our whole team uses Python 3.5 or 3.6 and we never came across such problem. I'm closing the issue for now, but let us know if you ever find out anything more about this.

@jakamoko I use Python 3.6 and Node 8.9.1 from Homebrew on macOS. I'm willing to help you investigate if you manage to reproduce this.

@elwoodxblues
Hi!
I faced with similar issue on Ubuntu
Using [email protected], [email protected]

Command:
npm run build-assets

Output:
[email protected] build-assets /home/user/saleor
node ./node_modules/webpack/bin/webpack.js -p

child_process.js:380
throw new TypeError('"file" argument must be a non-empty string');
^

TypeError: "file" argument must be a non-empty string
at normalizeSpawnArguments (child_process.js:380:11)
at exports.spawn (child_process.js:493:38)
at Object.exports.execFile (child_process.js:209:15)
at Object.execFile (/home/user/saleor/node_modules/pn/_promisify.js:35:27)
at module.exports (/home/user/saleor/node_modules/svg2png/lib/svg2png.js:11:29)
at Object.nearest (/home/user/saleor/node_modules/favicons/helpers-es5.js:302:25)
at /home/user/saleor/node_modules/favicons/es5.js:61:37
at fn (/home/user/saleor/node_modules/async/lib/async.js:746:34)
at /home/user/saleor/node_modules/async/lib/async.js:1213:16
at /home/user/saleor/node_modules/async/lib/async.js:166:37
at /home/user/saleor/node_modules/async/lib/async.js:706:43
at /home/user/saleor/node_modules/async/lib/async.js:167:37
at Object.async.waterfall (/home/user/saleor/node_modules/async/lib/async.js:710:44)
at createFavicon (/home/user/saleor/node_modules/favicons/es5.js:60:23)
at /home/user/saleor/node_modules/favicons/es5.js:108:24
at Object.async.forEachOf.async.eachOf (/home/user/saleor/node_modules/async/lib/async.js:233:13)
at createFavicons (/home/user/saleor/node_modules/favicons/es5.js:107:19)
at /home/user/saleor/node_modules/favicons/es5.js:118:24
at /home/user/saleor/node_modules/async/lib/async.js:718:13
at async.forEachOf.async.eachOf (/home/user/saleor/node_modules/async/lib/async.js:233:13)
at _parallel (/home/user/saleor/node_modules/async/lib/async.js:717:9)
at Object.async.parallel (/home/user/saleor/node_modules/async/lib/async.js:731:9)
at createPlatform (/home/user/saleor/node_modules/favicons/es5.js:117:19)
at /home/user/saleor/node_modules/favicons/es5.js:135:21
at Object.async.forEachOf.async.eachOf (/home/user/saleor/node_modules/async/lib/async.js:233:13)
at createOffline (/home/user/saleor/node_modules/favicons/es5.js:131:19)
at create (/home/user/saleor/node_modules/favicons/es5.js:178:90)
at /home/user/saleor/node_modules/favicons/es5.js:184:20
at fn (/home/user/saleor/node_modules/async/lib/async.js:746:34)
at /home/user/saleor/node_modules/async/lib/async.js:1213:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-assets: node ./node_modules/webpack/bin/webpack.js -p
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-assets script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2017-12-08T13_56_16_281Z-debug.log

I would be grateful if someone helps me.
2017-12-08T13_56_16_281Z-debug.log

@elwoodxblues
Hi! Do I need to open new bug report or we can discuss here?

Let's reopen this issue and discuss it here.

I don't know what happened, but today I decided to try again run "npm run build-assets" command and I've got everything working. Magic...

I am having the issue on Centos 7 here is the log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build-assets' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild-assets', 'build-assets', 'postbuild-assets' ]
5 info lifecycle [email protected]~prebuild-assets: [email protected]
6 info lifecycle [email protected]~build-assets: [email protected]
7 verbose lifecycle [email protected]~build-assets: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build-assets: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/jenny/virtualenvironment/my_bookstore_app/saleor/node_modules/.bin:/home/jenny/virtualenvironment/my_bookstore_app/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/jenny/.local/bin:/home/jenny/bin
9 verbose lifecycle [email protected]~build-assets: CWD: /home/jenny/virtualenvironment/my_bookstore_app/saleor
10 silly lifecycle [email protected]~build-assets: Args: [ '-c', 'node ./node_modules/webpack/bin/webpack.js -p' ]
11 silly lifecycle [email protected]~build-assets: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build-assets: Failed to exec build-assets script
13 verbose stack Error: [email protected] build-assets: `node ./node_modules/webpack/bin/webpack.js -p`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/jenny/virtualenvironment/my_bookstore_app/saleor
16 verbose Linux 3.10.0-693.el7.x86_64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build-assets"
18 verbose node v8.9.4
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build-assets: `node ./node_modules/webpack/bin/webpack.js -p`
22 error Exit status 1
23 error Failed at the [email protected] build-assets script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Hi guys, I also encounters this issue. Any update about it?
thank you!!!

Which version are you running? Does this happen on the current master branch?

yeah, it happened on master branch.

MacOs 10.13.2
node 9.4.0
npm 5.6.0
python 3.6

thx

hi guys,
It works now. I think the reason is that it failed to download some node's package, but it didn't show any error log.
I deleted node_modules folder and installed package again, it works.
thx

Was this page helpful?
0 / 5 - 0 ratings