Ionic Pro build Error and No Error in local


#1

I have an error in the build with Ionic Pro

npm info using node@v8.2.1
npm info lifecycle clientApp@0.0.1~prebuild: clientApp@0.0.1
npm info lifecycle clientApp@0.0.1~build: clientApp@0.0.1

clientApp@0.0.1 build /usr/src/app
ionic-app-scripts build

module.js:487
throw err;
^

Error: Cannot find module './templates.js’
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/usr/src/app/node_modules/chalk/index.js:6:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
npm info lifecycle clientApp@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! clientApp@0.0.1 build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the clientApp@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have no error when I build in local.
And I have no idea of the error.

What can I do ?


#2

found
https://github.com/ionic-team/ionic-app-scripts/issues/542

when i had an issue like that, i found out from support that when you send your project up.
Ionic Pro uses “npm install” based on your package.json file.

In my case it was issues with dependencies i had to clear up.

check your package.json for templates.js


#3

I haved already try this.
The npm install is ok.

I test on a copy of the project, remove before node_modules,
then:
npm install
npm run build

All is ok localy, bug error on Ionic Pro Build


#4

is it same error?

if GIT doesn’t see the file templates.js then it wont send it up. so you have it local but, GIT is not sending it up.

the point is the that what you have locally differs from what gets sent.


#5

Yes I can reproduce on my computer.
So now I can try to find the problem.

Thanks for your help


#6

The problem seem to come from the command on the build server:
npm install --quiet --no-optional

Before it was:
npm install

I continue to try to find the problem