4

I am developing a web application using angular and a few other libraries (including pixi.js), and I am trying to move the project onto a new machine. The project works on my old machine, but I'm having difficulties getting it to work on this new machine.

I moved across the project directly, which includes the package.json file and ran both npm install --only=dev and npm install. I then tried to start my application by running npm start. Everything worked well, my angular modules compiled successfully, but I got a bunch of errors that said:

ERROR in C:/.../.../.../.../.../.../.../pixi.component.ts (85,25): Identifier 'PIXI' must be imported from a module)

I got quite a few like this, basically every file where I used the identifier PIXI (for example var x = new PIXI.Point()) would throw an error.

I reiterate that this all works fine on my old machine, the node environment and code base is all the same. Anyways, I tried explicitly importing the namespace by adding import { PIXI } from 'pixi.js'. This threw an error in visual studio, saying cannot find module pixi.js.

I checked to see that the module was installed by using npm ls and I definitely have pixi.js 4.3.0 installed along with all my other modules. But for some reason it can't be found.

What could be causing this problem?

JavascriptLoser
  • 1,853
  • 5
  • 34
  • 61
  • Just trying to throw helpful ideas: The versions of installed modules could be different in those machines, if you npm install them. It might be worth checking that it doesn't mess things. Unless you have set specific versions to package.json. Also if you had something installed globally with npm on the old machine which is not in the new. – Hachi Feb 24 '17 at 19:32
  • If you are using webpack+awesome-typescript-loader try switching to ts-loader. It helped in my case. – SergeyK Feb 25 '17 at 10:02

0 Answers0