Closed jvanbruegge closed 7 years ago
From @SteveALee on July 31, 2017 13:45
../..
is incorrect when the package is linked in from create-cycle-app using a local flavor!
Perhaps detect is local flavor and then only ..
assuming flavor has been manually installed
From @SteveALee on August 2, 2017 8:8
As we are looking for the script in node_modules is there an API to get that rather than assuming relative path? Need to be the top one in the using package though in case there's another child one
The path is not the main problem. npm v5 changed something(TM) and not this is not working for me either
From @SteveALee on August 2, 2017 8:9
ah
the script should be symlinked in node_modules/.bin
by npm itself, but it seems like it's not doing that for symlinked packages
I have to investigate that and maybe open a bug report
From @SteveALee on August 2, 2017 8:11
Problem is the .bin is not in ../.. when flavor linked from app node_modules. That's the 1st problem I found. Is it the minimall flat package layout that broke it? Or was that earlier npm?
A solution might be to change the scripts to use
path.join(process.cwd(), 'node_modules', '.bin')
But then again, the binaries are not properly symlinked by npm
Maybe require.resolve
can help
From @SteveALee on August 2, 2017 8:19
hmm - probably OK, unless script launched from other directory - but seems very unlikely as we always cd project 1st
From @SteveALee on August 2, 2017 8:23
But then again, the binaries are not properly symlinked by npm
should they be? Surely only the flavor package folder gets linked and package.json updated to match with a 'file://' ?
Are you running scripts defined by the flavour. Then yes I see what you are saying. hmmm.
This is will be fixed with the next release of create-cycle-app by using yarn (npm v5 is buggy).
create-cycle-app myApp --flavor cycle-scripts-one-fits-all --yarn
https://github.com/cyclejs-community/create-cycle-app/issues/115
From @SteveALee on July 31, 2017 12:40
I'm using the local flavor option ie
create-cycle-app cspa-test --flavor ./create-cycle-app-flavors\packages\cycle-scripts-one-fits-all
Everything works until you try
npm start
etc. which fails withThe system cannot find the path specified.
This boils down to node's
child_process.execFileSync
being called with something likecommand: C:\WINDOWS\system32\cmd.exe
args: ['/s' ,'/c','""C:\projects\create-cycle-app-flavors\packages\.bin\webpack-dev-server" "--config" "C:\projects\create-cycle-app-flavors\packages\cycle-scripts-one-fits-all\configs\webpack.config.js""'
options: { env: { NODE_ENV: 'development' }, stdio: 'inherit', windowsVerbatimArguments: true }
I'm not sure why it's trying to tun the webserver in
"C:\projects\create-cycle-app-flavors\packages\.bin
which is invalid.Copied from original issue: cyclejs-community/create-cycle-app-flavors#42