#318·parallax

npm install doesn't seem to work when using `import`

Author: nathan-i-martinCreated Jun 12, 2022Updated Apr 6, 2024

Could not find a declaration file for module 'parallax-js'. 'C:/dev/premier-properties-management/node_modules/parallax-js/dist/parallax.js' implicitly has an 'any' type. Try 'npm i --save-dev @types/parallax-js' if it exists or add a new declaration (.d.ts) file containing 'declare module 'parallax-js';

This was the issue I received from Visual Studio Code while attempting to import a fresh npm install of Parallax. import Parallax from 'parallax-js'; I've since changed it to const Parallax = require('parallax-js'); which seems to work just fine.

I did also attempt to run the npm i --save-dev @types/parallax-js command however that didn't work out. I'm working in the Angular CLI environment (which includes babel), using typescript.