Skip to content

Cannot find module for a peerDependency of a devDependency #394

Description

@aecz

pnpm version: 0.38.1

Code to reproduce the issue:

npm i -g angular-cli
ng new myproject --skip-npm
cd myproject
pnpm i
ng build

EDIT:
Faster way to reproduce, thanks to @zkochan :

git clone https://github.com/zkochan/pnpm-issue394.git
cd pnpm-issue394
ng build

Expected behavior:

A folder dist is created in the project directory containing the app to deploy.

Actual behavior:

The command fails with the error: Cannot find module 'typescript'

Additional information:

Error: Cannot find module 'typescript'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\aecz\.pnpm-store\@ngtools+webpack@1.0.0\_\src\plugin.js:2:10)

Typescript dependency is correctly linked in myproject/node_modules but @ngtools/webpack do not "see" it and declares it as a peerDependency. Maybe because it is itself a dependency of angular-cli. Note that angular-cli is also correctly linked locally as the project declares it as devDependency.

Node v6.5.0 on Windows 7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions