Mari Selvan
Mari Selvan

Reputation: 3792

Have Error while try to Update Ember 2.14.2 to Ember 2.18.2

Anyone please help me with Ember update.My current code base was 2.14.2 and I try to update 2.18.2.And I got the below error.

Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Cannot find module 
'/sampleApp/bower_components/ember/ember-template-compiler.js'

Anyone, please guide me with this. If you have another method to upgrade the version of ember please let me know or please help to solve the issue.

Update

Full stack track:

Log File Source

`ENV Summary:

ERROR Summary:

- broccoliBuilderErrorStack: [undefined]
- code: MODULE_NOT_FOUND
- codeFrame: [undefined]
- errorMessage: Cannot find module 
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember- 
template-compiler.js'
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
 - line: [undefined]
- message: Cannot find module 
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember- 
 template-compiler.js'
 - name: Error
 - nodeAnnotation: [undefined]
 - nodeName: [undefined]
 - originalErrorMessage: [undefined]
 - stack: Error: Cannot find module 
'/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember- 
template-compiler.js'
  at Function.Module._resolveFilename 
 (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Class.htmlbarsOptions (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:78:25)
at Object.toTree (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:31:36)
at /Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:180:26
at Array.forEach (<anonymous>)
at processPlugins (/Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:178:11)
at module.exports.preprocessTemplates (/Users/mariselvan/Documents/sampleApp/node_modules/ember-cli-preprocess-registry/preprocessors.js:161:10)

=================================================================================

Ember-Cli version of the project :

ember-cli: 2.14.2
node: 10.13.0
os: darwin x64

Thanks in advance.

Upvotes: 0

Views: 610

Answers (1)

mistahenry
mistahenry

Reputation: 8744

I remember experiencing something like this around the late 2.x of ember. Basically, ember switched from bower to npm around 2.11 or so.

Are you using the ember-source npm version of ember? Your template compiler lookup is searching within bower which is most likely wrong if you've properly made the switch to npm, which you should have!

There's this issue that was fixed which may be the cause for you. Often times, updating the ember version alone isn't enough. For me, it was always easiest to update to the ember-cli version whose blueprint installed the version of ember that you are wanting (which will help you know what other core dependencies need updating). Looking through old release notes helps here.

If you are using an old ember-cli-htmlbars-inline-precompiler, you need to upgrade to:

 "ember-cli-htmlbars-inline-precompile": "^0.3.6"

If it's not either of those, please update your question with the full stack trace and the ember-cli version

EDIT: I'd like to help enable you to solve this issue yourself in the future so here's the detailed breakdown of how I reach my conclusion. In your stack trace, we see:

/Users/mariselvan/Documents/sampleApp/bower_components/ember/ember- 
template-compiler.js

This is looking for ember in bower which is no longer the case since you have ember-source in your package.json. This error results from

at Class.htmlbarsOptions (/Users/mariselvan/Documents/sampleApp/node_modules/ember-inplace-edit/node_modules/ember-cli-htmlbars/ember-addon-main.js:78:25)

So the conclusion here is that the version of ember-inplace-edit is old and you need to upgrade or fix yourself. Look at this addon's package.json and it's got this fixed dependency:

"dependencies": {
    "ember-cli-babel": "^5.1.3",
    "ember-cli-htmlbars": "0.7.9" // this was released Jun 12, 2015 
}

For the record, my ember 2.18 app bundled "ember-cli-htmlbars": "^2.0.1" by default. So lets go to the release of 0.7.9, download the source code, and look at the offending line in :

templateCompilerPath: function() {
    var config = this.projectConfig();
    var templateCompilerPath = config['ember-cli-htmlbars'] && config['ember-cli-htmlbars'].templateCompilerPath;

    if (!templateCompilerPath) {
      // THIS ONLY WORKS FOR BOWER VERSIONS OF EMBER
      templateCompilerPath = this.project.bowerDirectory + '/ember/ember-template-compiler'; 
    }

    return path.resolve(this.project.root, templateCompilerPath);
  }

So you have a couple of reasonable options

  1. Fix the addon and make it support later Ember versions and open a PR to get merged upstream (by updating this ember cli htmlbars dependency)
  2. Fork the addon and fix it without merging upstream and point to your fork
  3. Remove the addon and rework this part of your application
  4. use the templateCompilerPath option to point to your ember-source version (but this is honestly the worst option)

Upvotes: 1

Related Questions