0

I am getting all these warning while installing ts loader and css loader..

npm ts loader

user@user-ThinkPad-T420s:~$ npm install --save-dev ts-loader
npm WARN saveError ENOENT: no such file or directory, open '/home/user/package.json'
/home/user
`-- ts-loader@2.1.0 

npm WARN enoent ENOENT: no such file or directory, open '/home/user/package.json'
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.

npm css loader

user@user-ThinkPad-T420s:~$ npm install --save-dev css-loader
    npm WARN saveError ENOENT: no such file or directory, open '/home/user/package.json'
    /home/user
    `-- css-loader@0.28.2 

    npm WARN enoent ENOENT: no such file or directory, open '/home/user/package.json'
    npm WARN user No description
    npm WARN user No repository field.
    npm WARN user No README data
    npm WARN user No license field.

can anyone tell me how i can fix this ?

Mayank Sethi
  • 197
  • 1
  • 1
  • 10
  • npm doesn't find your _package.json_ file, seems you are not in your project folder, and it fail to save ts-loader as a dependency. – TGrif May 24 '17 at 17:17
  • please help me understand how to use css-loader in bundling with webpack – Mayank Sethi May 24 '17 at 21:45

1 Answers1

0

This is happening because you pass --save-dev parameter to npm when you install ts-loader and css-loader modules in a directory with no package.json in it.

If this is a new project, I suggest you to start by npm init, as it will create you a fresh package.json file for your project.

You can always install dependency globally if you needed it for more than one project:

npm install -g ts-loader css-loader

Others alert are not very important, but you can add a licence and a README file to get rid of it if you care.

TGrif
  • 5,725
  • 9
  • 31
  • 52