SOLVED

Warnings when doing gulp bundle

%3CLINGO-SUB%20id%3D%22lingo-sub-833086%22%20slang%3D%22en-US%22%3EWarnings%20when%20doing%20gulp%20bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-833086%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI'm%20building%20a%20solution%20with%20SharePoint%20Framework%201.9.1.%3C%2FP%3E%3CP%3EIt%20contains%20one%20single%20but%20rather%20complex%20Webpart.%20Whenever%20I%20do%20%22gulp%20bundle%22%20(with%20or%20without%20--ship)%20I'm%20getting%20a%20bunch%20of%20warning%20messages%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%5B16%3A37%3A58%5D%20Starting%20subtask%20'configure-webpack'...%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22%40microsoft%2Fnode-core-library%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22%40types%2Flodash%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22%40microsoft%2Fmicrosoft-graph-client%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22%40types%2Fadal-angular%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22adal-angular%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22es6-collections%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22%40types%2Frequirejs%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A58%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22requirejs%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A37%3A59%5D%20Warning%20-%20%5Bconfigure-webpack%5D%20Unable%20to%20resolve%20project%20%22prop-types%22.%20Ensure%20it%20has%20been%20linked.%20%0A%5B16%3A38%3A01%5D%20Finished%20subtask%20'configure-webpack'%20after%202.97%20s%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAs%20far%20as%20I%20can%20tell%20the%20solution%20is%20working%20fine.%20I%20didn't%20import%20and%20I'm%20not%20directly%20using%20any%20of%20the%20mentioned%20packages%20in%20my%20solution%20and%20they%20aren't%20referenced%20in%20the%20package.json%20either.%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20what%20can%20be%20done%20to%20get%20rid%20of%20those%20warnings%3F%20They%20make%20it%20harder%20to%20spot%20the%20real%20problems%20when%20building%20the%20solution.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I've%20tried%20so%20far%3A%3C%2FP%3E%3CUL%3E%3CLI%3EReinstalled%20Node.js%3C%2FLI%3E%3CLI%3EReinstalled%20gulp%3C%2FLI%3E%3CLI%3EUpgraded%20npm%20to%206.1.0%3C%2FLI%3E%3CLI%3ERun%20%22npm%20dedupe%22%20and%20%22npm%20install%22%20in%20the%20root%20dir%20of%20the%20solution%3C%2FLI%3E%3CLI%3EInstalled%20one%20of%20the%20mentioned%20packages%20with%20%22npm%20install%20package-name%22%3C%2FLI%3E%3C%2FUL%3E%3CP%3EBut%20all%20of%20that%20didn't%20affect%20any%20single%20warning.%3C%2FP%3E%3CP%3EHoping%20someone%20can%20help%20me%20with%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-837603%22%20slang%3D%22en-US%22%3ERe%3A%20Warnings%20when%20doing%20gulp%20bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-837603%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62047%22%20target%3D%22_blank%22%3E%40Christian%20Walling%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Christian%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20a%20solution%20that%20you're%20opening%20from%20source%20control%2C%20or%20something%20you've%20completely%20written%20in%20your%20environment%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20thing%20I'd%20do%20is%20delete%20and%20rebuilt%20the%20entire%20node_modules%20folder%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Erm%20rf%20node_modules%0Anpm%20i%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you're%20not%20working%20on%20this%20together%20with%20a%20group%20of%20people%20who%20all%20need%20to%20be%20on%20the%20same%20exact%20version%20of%20the%20project%20(for%20example%20if%20you%20are%20working%20alone%20in%20your%20environment%2C%20but%20you%20cloned%20the%20project%20from%20github)%20I'd%20delete%20the%20package-lock.json%20file%20as%20well%20before%20npm%20i%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-838248%22%20slang%3D%22en-US%22%3ERe%3A%20Warnings%20when%20doing%20gulp%20bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-838248%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F241707%22%20target%3D%22_blank%22%3E%40Thomas%20Berman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20your%20tips.%20Initially%20it%20didn't%20work%20but%20there%20were%20two%20library%20components%20which%20we%20developed%20linked%20to%20the%20solution.%20So%20I%20repeated%20the%20same%20steps%20for%20both%20libraries%20and%20after%20that%20the%20warnings%20disappeared.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20deleted%20the%20package-lock.json%20in%20the%20main%20solution%20and%20the%20libraries.%20Why%20do%20you%20think%20that%20could%26nbsp%3B%20be%20a%20problem%20for%20colleagues%20working%20together%20with%20me%3F%20I%20looked%20in%20our%20source%20control%20system%20and%20saw%20that%20neither%20the%20node_modules%20nor%20the%20package-lock.json%20are%20checked%20in%20there.%20So%20everyone%20has%20it's%20own%20version%20of%20that%20anyway%20and%20the%20others%20had%20no%20warnings%20when%20doing%20gulp%20serve%20on%20solutions%20using%20the%20library%20components.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

I'm building a solution with SharePoint Framework 1.9.1.

It contains one single but rather complex Webpart. Whenever I do "gulp bundle" (with or without --ship) I'm getting a bunch of warning messages:

[16:37:58] Starting subtask 'configure-webpack'... 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "@microsoft/node-core-library". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "@types/lodash". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "@microsoft/microsoft-graph-client". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "@types/adal-angular". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "adal-angular". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "es6-collections". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "@types/requirejs". Ensure it has been linked. 
[16:37:58] Warning - [configure-webpack] Unable to resolve project "requirejs". Ensure it has been linked. 
[16:37:59] Warning - [configure-webpack] Unable to resolve project "prop-types". Ensure it has been linked. 
[16:38:01] Finished subtask 'configure-webpack' after 2.97 s

As far as I can tell the solution is working fine. I didn't import and I'm not directly using any of the mentioned packages in my solution and they aren't referenced in the package.json either.

Does anyone know what can be done to get rid of those warnings? They make it harder to spot the real problems when building the solution.

 

What I've tried so far:

  • Reinstalled Node.js
  • Reinstalled gulp
  • Upgraded npm to 6.1.0
  • Run "npm dedupe" and "npm install" in the root dir of the solution
  • Installed one of the mentioned packages with "npm install package-name"

But all of that didn't affect any single warning.

Hoping someone can help me with that.

2 Replies
best response confirmed by Christian Walling (Occasional Contributor)
Solution

@Christian Walling 

 

Hi Christian,

 

Is this a solution that you're opening from source control, or something you've completely written in your environment?

 

The first thing I'd do is delete and rebuilt the entire node_modules folder

 

 

 

rm rf node_modules
npm i

 

 

 

If you're not working on this together with a group of people who all need to be on the same exact version of the project (for example if you are working alone in your environment, but you cloned the project from github) I'd delete the package-lock.json file as well before npm i

@Thomas Berman 

thanks for your tips. Initially it didn't work but there were two library components which we developed linked to the solution. So I repeated the same steps for both libraries and after that the warnings disappeared. 

I also deleted the package-lock.json in the main solution and the libraries. Why do you think that could  be a problem for colleagues working together with me? I looked in our source control system and saw that neither the node_modules nor the package-lock.json are checked in there. So everyone has it's own version of that anyway and the others had no warnings when doing gulp serve on solutions using the library components.