pnpm: Project build error using gulp when dependencies were install using pnpm

In my case I am using gulp-less plugin to build less files to css. I have no problem if the dependencies were installed using npm install, but when using pnpm install I got the following error:

Error: 'tried to require: less'. None found. Make sure one has been installed!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I looked into accorn and resolve and both seem to work fine.

I see two possible issues here:

  1. you might run the task with a gulp that was installed not via pnpm. You have to install the global gulp with pnpm in order to make this work because gulp has to be executed with the --preserve-symlinks option
  2. if you run it directly. Like node index.js, then you’ll have to run it with the --preserve-symlinks parameter. An important note: the parameter should be at the beginning. So you have to run node --preserve-symlinks index.js