Skip to content

After upgraded to nativescript 3.1.2, tns run android still works. But npm run start-android-bundle get error #2962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xgu01 opened this issue Jul 7, 2017 · 6 comments

Comments

@xgu01
Copy link

xgu01 commented Jul 7, 2017

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Yes

Tell us about the problem

After upgraded to nativescript 3.1.2, tns run android still works. But npm run start-android-bundle get error

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.1.2
  • Cross-platform modules: (check the 'version' attribute in the
    3.1.0
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    3.1.1
  • Plugin(s): (look for the version number in the package.json file of your
    project)

Please tell us how to recreate the issue in as much detail as possible.

tns create ng1 --ng
npm install --save-dev nativescript-dev-webpack
npm install
npm run start-android-bundle

error message:
C:\SVN\dev\test\ng1>npm run start-android-bundle

@ start-android-bundle C:\SVN\dev\test\ng1
npm run ns-bundle --android --run-app

@ ns-bundle C:\SVN\dev\test\ng1
ns-bundle

Running tns prepare...
module.js:471
throw err;
^

Error: Cannot find module 'C:\SVN\dev\test\ng1\node_modules\nativescript\bin\tns
'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
child process exited with code 1

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\xgu\AppData\Ro
aming\npm\node_modules\npm\bin\npm-cli.js" "run" "ns-bundle" "--android" "-
-run-app"
npm ERR! node v6.9.5
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! @ ns-bundle: ns-bundle
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ ns-bundle script 'ns-bundle'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ns-bundle
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\SVN\dev\test\ng1\npm-debug.log

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\xgu\AppData\Ro
aming\npm\node_modules\npm\bin\npm-cli.js" "run" "start-android-bundle"
npm ERR! node v6.9.5
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! @ start-android-bundle: npm run ns-bundle --android --run-app
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start-android-bundle script 'npm run ns-bundle --androi
d --run-app'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run ns-bundle --android --run-app
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\SVN\dev\test\ng1\npm-debug.log

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

@dtopuzov
Copy link
Contributor

Hi @xgu01,

Can you please add android platform before npm run and try again?

tns create TestApp
cd TestApp
tns platform add android
npm install --save-dev nativescript-dev-webpack
npm install
npm run start-android-bundle

npm install will not install platforms since they are not treated as npm packages and npm run start-android-bundle will also not automatically add them if they are missing.

@ButterMeWaffle
Copy link

@dtopuzov

following the exact steps above I am given the same error as OP. Brand new project and I ran everything in the order you said.

@dtopuzov
Copy link
Contributor

dtopuzov commented Jul 12, 2017

Hi @SamuelGRwebfab

It looks to be NativeScript/nativescript-dev-webpack#214

Can you downgrade to [email protected] and try again?

If that is the case, it will be resolved later today or tomorrow with [email protected].

@xgu01
Copy link
Author

xgu01 commented Jul 12, 2017 via email

@ButterMeWaffle
Copy link

@xgu01

I figured it out, i needed to downgrade to 0.7.0 to resolve all of my issues.

@dtopuzov
Copy link
Contributor

@SamuelGRwebfab @xgu01
The issues is also fixed in [email protected], so you can safely upgrade to newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants