xenoterracide xenoterracide - 1 month ago 14
TypeScript Question

typescript unable to find modules on windows?

I've got the following errors being emitted from webpack dev server, I didn't get these errors before I migrated to windows.

[default] C:\Users\xeno\IdeaProjects\rpf-ui\custom_typings\fetch.d.ts:1:1
File 'C:/Users/xeno/IdeaProjects/rpf-ui/node_modules/@types/whatwg-fetch/index.d.ts' not found.
[default] C:\Users\xeno\IdeaProjects\rpf-ui\src\security\register\RegistrationSvc.ts:4:45
Cannot find module 'src/security/authn/credentials/UsernamePasswordCredentials'.
[default] C:\Users\xeno\IdeaProjects\rpf-ui\typings\globals\whatwg-fetch\index.d.ts:88:11
Cannot find name 'ReadableStream'.
[default] Checking finished with 3 errors

I had more failures before I ran this. Worth saying all of those files are available at those locations, though I'm concerned that they're being shown with
and not
since this is on windows and wasn't happening on linux.

that said my versions all look more recent than what I was running on linux.

npm -v && au --version && npm list typescript aurelia-framework webpack
rpf@0.1.12 C:\Users\xeno\IdeaProjects\rpf-ui
+-- aurelia-framework@1.0.2
+-- typescript@2.0.2
+-- typings@1.3.3
| `-- typings-core@1.4.1
| `-- typescript@1.8.7
`-- webpack@2.1.0-beta.21

how can I fix these errors? warnings? I can add information, but I'm not sure what's relevant.


Too ensure your using the same versions as you were on Linux I would go back to that working version of the project on that other dev enviroment and run npm shrinkwrap.

This will create a npm-shrinkwrap.json. With this new file go back to your Windows dev environment delete the local node_modules directory and run npm cache clean.

Then go about reinstalling the modules with npm install.

Also check you're running the same version of node and au as you were on the Linux environment.

Failing that it's likely an issue with one of the modules you're using not using the path module to sanitize file paths across platforms.

In which case I would recommend running a seperate developer enviroment on Windows within a VM / Container (Vagrant, Docker), or try using bash for Windows as your shell.