NativeScript / nx

NativeScript for Nx.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Report node/npm/nx/ns versions

mahmoudajawad opened this issue · comments

Hello.

I had bad node installation, so I nuked it all and re-installed everything. Now I have:

$ node -v
v15.14.p
$ npm -v
7.7.6

And, I'm on macos catalina 10.15.7.

For some reason I can't build or run nativescript app as part of Nx workspace now after re-installation. I'm assuming it has something to do with version incompatibility. So, could you report the versions that are working for you?

For reference, the error I get:

$ npx nx run nativescript-app:ios

> nx run nativescript-app:ios 
Searching for devices...
npm ERR! code 127
npm ERR! path /path/to/workspace/node_modules/typescript
npm ERR! command failed
npm ERR! command sh -c gulp build-eslint-rules
npm ERR! sh: gulp: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /HOME/.npm/_logs/2021-04-18T11_26_39_027Z-debug.log
Unable to install dependencies. Make sure your package.json is valid and all dependencies are correct. Error is: Command npm failed with exit code 127
Done.

Inside apps/nativescript-app/package.json change typescript to use version instead of file ref. Can be ~4.0.0 or ~4.1.0.

Then:
npx nx run nativescript-app:clean

I’ve heard of some issues with npm 7 higher versions with file ref dep’s. Will probably release a patch update that removes file ref’s today.

1.0.3 was released that uses versions for the dependencies which have issue with npm 7+. If you make the above modification manually will work or can update to 1.0.3 and regenerate the app.

Great and thanks for replying. I shall give this a shot for it soon.

So, v1.0.3 now allows me to run npx nx run nativescript-app:clean successfully, but still can't run npx nx run nativescript-app:ios, as I get the following error:

Preparing project...
[webpack-cli] Error: Unknown option '--env.hmr'
[webpack-cli] Run 'webpack --help' to see available commands and options
Executing webpack failed with exit code 2.
Done.

Note that I have nativescript v7.2.1 installed and not v8. Does that have anything to do with it?

Ah yes - this is 8.0 and generally you always want the latest cli installed. We all use cli 8.0.1 latest with all our daily work as it works for 6, 7 and 8 projects.

You are definitely right. It works for me now. Thanks.

Proof (For no other reason but to share this beautiful screen xD):
simulator_screenshot_F5FE5ABA-BD14-4F3F-940C-DABDF3A1AF42